Xamarin如何加边框

博客介绍了移动开发中设置边框的两种方法。方法一是通过设置内层与外层背景颜色差,用padding设置边框;方法二则是使用Frame,可套在外面设置边框,还能设置圆边。内容转载自相关博客。

方法1:两个层,内层与外层用背景颜色差,padding设置边框

<StackLayout BackgroundColor="White">
<StackLayout BackgroundColor="Black" Padding="1">
<Editor BackgroundColor="White" />
</StackLayout>
...
</StackLayout>

方法2:Frame 可以套在外面设置边框也可以设置圆边

1 <Frame Grid.Row="1" MinimumHeightRequest="200" BorderColor="Black" CornerRadius="20" HasShadow="True" BackgroundColor="#cfe2f3">
2 <StackLayout BackgroundColor="Transparent" VerticalOptions="FillAndExpand">
3 <radialView:RadialProgressView VerticalOptions="FillAndExpand" BindingContext="{Binding radialProgressViewModel}" />
4 <Label FontSize="Large" Text="实时数据" TextColor="#3399CC" VerticalOptions="End" HorizontalTextAlignment="Center"></Label>
5 </StackLayout>
6 </Frame>

 

转载于:https://www.cnblogs.com/Xamarin-Oz/p/11069183.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值