gpt4 book ai didi

listview - 如何在xamarin中设置帧边距?

转载 作者:行者123 更新时间:2023-12-02 19:12:48 24 4
gpt4 key购买 nike

我正在使用自定义单元格创建 ListView 。我在 Viewcell 内使用 Frame。它在 Android 设备中显示良好,但在 IOS 中它不显示两个框架之间的边距。我如何为 IOS 设置此功能?

Viewcell的代码是:

 <ViewCell>
<StackLayout>
<Frame Margin="10" BackgroundColor="White" CornerRadius="5" HasShadow="False" IsClippedToBounds="False">
<StackLayout>
<Label Text="{Binding Name}" FontFamily="Raleway-Regular" FontSize="24" TextColor="#262628" HorizontalTextAlignment="Center" FontAttributes="Bold"></Label>
<Label Text="{Binding Description1}" FontSize="15" HorizontalTextAlignment="Center" TextColor="#262628" FontAttributes="Bold" Margin="0,5"></Label>
<ContentView HorizontalOptions="Center" Padding="0" Content="{Binding IngredientsArray1, Converter={StaticResource arrayToStackLayout}}" />
</StackLayout>
</Frame>
</StackLayout>
</ViewCell>

IOS Output is :

image

最佳答案

我刚刚将上面的代码更改为:

 <ViewCell>
<ContentView>
<Frame Margin="10" BackgroundColor="White" CornerRadius="5" HasShadow="False" IsClippedToBounds="True">
<StackLayout Margin="5">
<Label Text="{Binding Name}" FontFamily="Raleway-Bold" FontSize="24" TextColor="#262628" HorizontalTextAlignment="Center" FontAttributes="Bold"></Label>
<Label Text="{Binding Description1}" FontSize="15" HorizontalTextAlignment="Center" TextColor="#262628" FontAttributes="Bold" Margin="0,5"></Label>
<ContentView HorizontalOptions="Center" Padding="0" Content="{Binding IngredientsArray1, Converter={StaticResource arrayToStackLayout}}" />
</StackLayout>
</Frame>
</ContentView>
</ViewCell>

关于listview - 如何在xamarin中设置帧边距?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49376300/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com