-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] [UWP, iOS] Can't set transparent color on selected template item in CollectionView #11421
Comments
@themronion Do you mean modify the background color using the Selected VisualState? |
@jsuarezruiz yeap |
Any progress here? |
I have done some tests on Android, iOS and UWP. The behavior seems the same on all platforms:
Android Using:
Using transparent: The expected behavior would be not to apply any selected color (avoid the native selection color)? |
Yes, on android i managed somehow to avoid the selection color in a selected collection view item. As i now realized this wasn't because i was setting a transparent color in the vsm. But how then to acheive not a gray background (on ios) on a selected collection view item, but a transparent one? Using custom renderers i did the trick with a listview, but how to write a renderer to remove the selection color in a collection view in ios a have no idea. I thought i would acheive that with VSM, but no... maybe you can give me a tip? |
#12651) fixes #7790 fixes #9590 fixes #11421 * Correction of CollectionView to work properly with selected item color when using VisualState on Android and iOS * Update TemplatedCell.cs * Update TemplatedItemViewHolder.cs * Add scaling to make the bug more obvious * Make fix work for on-template visual states on iOS * Make fix for for on-template visual states on Android * Minor performance optimization * Make method name more explicit * Spaces -> Tabs * Fix UI test failure (item 3 doesn't fit on the screen anymore) Co-authored-by: Rony Mesquita <ronymesquitadasilva@gmail.com>
Hi, This still seems to be an issue in XF 5.0.0.2083. This code makes the selected frame transparent on Android, but an ugly gray on iOS. Are there other ways to achieve a transparent background on the selected item in a CollectionView for iOS? <VisualStateManager.VisualStateGroups>
<VisualStateGroup Name="CommonStates">
<VisualState Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="Transparent" />
</VisualState.Setters>
</VisualState>
<VisualState Name="Selected">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="Transparent" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>` |
Description
Can't set transparent color on selected template item in CollectionView on iOS. Other colors work. As i found the issue with "selected" state in UWP is being resolved so maybe this is only an iOS issue
Steps to Reproduce
Expected Behavior
Color is being set to Transparent on all platforms
Actual Behavior
Color is not being set to Transparent on iOs (uwp)
Workaround
Set background color as property of binded observablecollection item
The text was updated successfully, but these errors were encountered: