开发者

How can I round just the bottom corners of a UIView? [duplicate]

开发者 https://www.devze.com 2023-03-27 17:40 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicates: UIView with rounded corners
This question already has answers here: Closed 11 years ago.

Possible Duplicates:

UIView with rounded corners

Round two corners in UIView

I'm aware of means for rounding all four corners of a UIV开发者_如何学Ciew, but how could I round only the bottom corners of a view?


To achieve this, you need to use CALayer masking. This question Just two rounded corners? and the accepted answer should get you started. If you run in to trouble, then you should take a look at this follow-up post: Round two corners in UIView


You can draw in one CALayer filled rectangle with bottom rounded corners and than set it as mask to your:

[[view layer] setMask:calayerWithDrawedMaskingRect];
0

精彩评论

暂无评论...
验证码 换一张
取 消