当前位置 : 主页 > 手机开发 > ios >

xaml – iOS上的框架角半径不圆角

来源:互联网 收集:自由互联 发布时间:2021-06-11
我试图围绕堆栈布局的角落,它适用于 Android,但在iOS上,它们仍然显示为方形,但它确实显示帧阴影 我的XAML是 ContentPage.Content StackLayout BackgroundColor="WHITE" ListView ListView.ItemTemplate DataTemplate
我试图围绕堆栈布局的角落,它适用于 Android,但在iOS上,它们仍然显示为方形,但它确实显示帧阴影

我的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>

enter image description here

StackLayout

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

enter image description here

it does display the Frame shadow

您可以通过HasShadow =“False”禁用它.

网友评论