0

我正在尝试创建类似于 Android cardview 的布局。

我目前的进展。

图像1

如您所见,它看起来很好。但是,当我将 Image 属性 Aspect="Fill" 更改为 Aspect="AspectFill" 时,图像会丢失圆角。

图2

我的代码

<Frame 
        VerticalOptions="Start"
        Margin="8" 
        CornerRadius="10"  
        Padding="0"
        BackgroundColor="White"
        IsClippedToBounds="False">
        <StackLayout Spacing="0">
            <Image 
                HeightRequest="150"                         
                Source="{Binding ImageUrl}" 
                Aspect="AspectFill"
                />
            <StackLayout
                Spacing="1"
                Margin="8"
                >
                <Label
                    FontFamily="{StaticResource MontserratMedium}"
                    TextColor="Black"
                    Text="{Binding Title}">
                </Label>

                <StackLayout
                    Orientation="Horizontal"                     
                    >
                    <Label
                        FontFamily="{StaticResource MontserratMedium}"
                        FontSize="13"
                        TextColor="{StaticResource TextColorDate}"
                        Text="Price">
                    </Label>
                    <Label
                        FontFamily="{StaticResource MontserratBold}"
                        FontSize="13"
                        HorizontalOptions="EndAndExpand"
                        TextColor="{StaticResource TextColorCash}"
                        Text="{Binding Price,StringFormat='{0}K'}">
                    </Label>
                </StackLayout>
            </StackLayout>
        </StackLayout>
    </Frame>

是否有解决方案让 Image 具有属性 Aspect="AspectFill" 和圆角?

4

0 回答 0