很多问题
并启用
剪辑子视图
结果:
Lots of questions like this explain how to programmatically create a mask and provide rounded corners to a UIView.
Is there a way to do it all within Storyboard? Just asking because it seems like creating rounded corners in Storyboard keeps a clearer demarcation between presentation and logic.
Yes, I use that a lot but question like this was already answered many times.
But anyway in Interface Builder. You need to add User Defined Runtime Attributes like this:
layer.masksToBounds Boolean YES
layer.cornerRadius Number {View's Width/2}
and enable
Clips subviews
Results:
这篇关于使用 Storyboard 遮罩 UIView 并给出圆角?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!