【发布时间】:2020-07-19 10:02:52
【问题描述】:
【问题讨论】:
标签: user-interface xamarin.forms custom-controls custom-renderer
【问题讨论】:
标签: user-interface xamarin.forms custom-controls custom-renderer
您可以使用 Frame 并设置 Padding 和 CornerRadius 。
例如
<StackLayout VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand">
<Frame BackgroundColor="Red" CornerRadius="10" WidthRequest="100" HeightRequest="50" Padding="5">
<Frame BackgroundColor="White" CornerRadius="8" WidthRequest="90" HeightRequest="40" Padding="5" >
<Frame BackgroundColor="Red" CornerRadius="8" WidthRequest="80" HeightRequest="30" Padding="0">
<Label Text="11111" TextColor="White" FontSize="20" VerticalTextAlignment="Center" HorizontalTextAlignment="Center"/>
</Frame>
</Frame>
</Frame>
</StackLayout>
您可以将上面的代码放在自定义视图中,并将颜色和文本绑定在后面的代码中。
【讨论】: