Border radius on Entry Xamarin Forms PCL

柔情痞子 提交于 2019-12-23 17:05:13

问题


Is there a way to set a border radius on an Entry in Xamarin's XAML, or by using a custom renderer or something ?

Everything I've tried up to now has no effect, but for my application it would be really better if I had round borders.

Thank you in advance for your answer !

PS : I've checked this post but I've not found my answer there :)


回答1:


I think you can use a grid with 1 row and 1 column Inside the grid you can add your Entry and, for example, this control, in the same (the only) cell. You should have an Entry with rounded corners...

This is another useful control (XFShape). Create shapes content views from shared code for your mobile apps! For Android and iOS.




回答2:


I've posted this answer here too, but for convenience I'll just paste it below:

I'm not sure if there's something wrong with this approach or not, because it seems so simple but no one's suggesting it.

But I don't see why you can't just use a Frame with IsClippedToBounds set to true. That gives you a built-in corner radius, which you can then adjust as needed.

        <Grid>               
             <Frame
                   CornerRadius     ="20"
                   IsClippedToBounds="true">
                <Editor />
            </Frame>
         </Grid>

I'm currently using this solution and it works for me.



来源:https://stackoverflow.com/questions/42598150/border-radius-on-entry-xamarin-forms-pcl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!