Forum Xamarin.Forms

How can I make a border around a selected item?

Dear experts,

I have a ListView with only two items it it. I need to make a border appear around the selected item. How can I do this?
Here is my code:

        <ListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell Height="100">
                        <StackLayout BackgroundColor="{StaticResource LogoBackgroundColor}"
                                Padding="15,10" 
                                Orientation="Horizontal" 
                                HorizontalOptions="FillAndExpand">
                            <Image WidthRequest="50" Source="{Binding IconSource}" Margin="10, 0" />
                            <Label VerticalOptions="FillAndExpand" 
                                VerticalTextAlignment="Center" 
                                Text="{Binding Title}" 
                                TextColor="White"
                                FontSize="24"/>
                        </StackLayout>
                    </ViewCell>
                </DataTemplate>

Thanks!

Best Answer

Answers

  • dpreznikdpreznik Member ✭✭
    edited December 2018

    Thank you very much! I use OutlineColor, it seems to do the job. Is there any reason to use BackgroundColor instead?

    Thanks again.

Sign In or Register to comment.