Search code examples
c#xamarinxamarin.formsxamarin.androidcollectionview

Rounded corners of selected item in collection view


I have a collectionview.When I click on image,background of selected item become orange,can you help me and say,how I can make rounded corners of this orange background.I write on Android.Please,help enter image description here


Solution

  • I think the easiest way to do this is to add a Frame outside the image and set its rounded corners and background color (make sure your icon is transparent background) .

    <Frame HorizontalOptions="Start" CornerRadius="10" BackgroundColor="Orange" WidthRequest="40" HeightRequest="40" Padding="0">
        <Image Source="heart.png" Aspect="AspectFill"></Image>
    </Frame>
    

    the effect:

    enter image description here