我试图围绕堆栈布局的角落,它适用于 Android,但在iOS上,它们仍然显示为方形,但它确实显示帧阴影 我的XAML是 ContentPage.Content StackLayout BackgroundColor="WHITE" ListView ListView.ItemTemplate DataTemplate
我的XAML是
<ContentPage.Content>
<StackLayout BackgroundColor="WHITE">
<ListView>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout>
<Frame CornerRadius="10" Padding="0" Margin="10, 10, 10, 10">
<StackLayout>
. . .
</StackLayout>
</Frame>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentPage.Content>
they still appear square
实际上,Frame是Round而不是StackLayout,我们只是使用Frame wrap it,所以看起来StackLayout有圆角.
帧
<Frame CornerRadius="10" Padding="0" Margin="10, 10, 10, 10" HasShadow="False" BackgroundColor="Red">
<StackLayout >
<Label Text="{Binding}"/>
</StackLayout>
</Frame>

StackLayout
<Frame CornerRadius="10" Padding="0" Margin="10, 10, 10, 10" HasShadow="False" >
<StackLayout BackgroundColor="Red">
<Label Text="{Binding}"/>
</StackLayout>
</Frame>

it does display the Frame shadow
您可以通过HasShadow =“False”禁用它.
