Xamarin Forms:带圆角的 StackLayout [英] Xamarin Forms: StackLayout with rounded corners

查看:33
本文介绍了Xamarin Forms:带圆角的 StackLayout的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Xamarin Forms PCL 开发应用程序.我需要一个带圆角的 StackLayout.我也为圆角容器尝试过框架,但没有可用的圆角半径属性.我找不到适用于 iOS、Android、UWP、Windows 8.1 的渲染器.

I am developing an app using Xamarin Forms PCL. I need a StackLayout with rounded corners. I have tried frame as well for rounded corner container but there is no corner radius property available for it. I cannot find renderers for iOS,Android,UWP,Windows 8.1.

请有人建议我如何为所有平台实现带有圆角的 StackLayout 和圆角半径属性.

Please can any one suggest me how to achieve StackLayout with rounded corners along with corner radius property for all the platforms.

推荐答案

可以使用 Frame 将 StackLayout 放在里面,注意 Frame 默认采用 padding 20 :

You can use Frame and put StackLayout inside , Note Frame take padding 20 by default :

<Frame CornerRadius="10"  
       OutlineColor="Red" 
       Padding="0">
            <StackLayout>

            </StackLayout>
</Frame>

这篇关于Xamarin Forms:带圆角的 StackLayout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆