I found a error when you select a item all the children backgrounds are change for the same color.
In all elements, I put the property BackgroundColor. This only happened in the iOS
Follow the sample of the code:
XAML
<ListView
x:Name="ListPainel"
SeparatorColor="#d2d8e2"
SeparatorVisibility="Default"
Margin="0"
ItemsSource="{Binding ListPainel_Source}"
HasUnevenRows="true"
RefreshCommand="{Binding ListPainel_RefreshCommand}"
IsRefreshing="{Binding ListPainel_IsRefreshing}"
>
</ListView>
Part of ViewCell
protected override void OnBindingContextChanged()
{
base.OnBindingContextChanged();
dynamic temp = BindingContext;
PainelDto painel = (PainelDto)temp;
...
if(painel.HasDetalhes)
{
Button detalhes = new Button()
{
Text="VER DETALHES",
FontSize = 12,
TextColor = Color.FromHex("#4482ff"),
HorizontalOptions = LayoutOptions.End,
VerticalOptions = LayoutOptions.Start,
HeightRequest = 20,
WidthRequest = 120,
BackgroundColor = Color.DeepPink
};
detalhes.SetBinding(
Button.CommandProperty
, new Binding(
"ViewDetalhesCommand"
, BindingMode.Default
, null
, null
, null
, _viewModelPainel
)
);
box.Children.Add(detalhes);
}
...
View = box;
}
Unselected Item
Selected Item
Some one know how to fix this?