【问题标题】:Rounded corners of selected item in collection view集合视图中所选项目的圆角
【发布时间】:2020-08-11 21:36:23
【问题描述】:

我有一个collectionview。当我单击图像时,所选项目的背景变成橙色,你能帮我说一下,我怎样才能使这个橙色背景的圆角。我在Android上写。请帮忙 enter image description here

【问题讨论】:

  • 可以吗?

标签: c# xamarin xamarin.forms xamarin.android collectionview


【解决方案1】:

我认为最简单的方法是在图像外添加Frame 并设置其圆角和背景颜色(确保您的图标是透明背景)。

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

效果:

【讨论】:

    猜你喜欢
    • 2015-05-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多