Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Possible Duplicates:
UIView with rounded corners
Round two corners in UIView

I'm aware of means for rounding all four corners of a UIView, but how could I round only the bottom corners of a view?

like image 943
aryaxt Avatar asked Nov 05 '22 16:11

aryaxt


2 Answers

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

like image 64
PengOne Avatar answered Nov 11 '22 02:11

PengOne


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

[[view layer] setMask:calayerWithDrawedMaskingRect];
like image 23
Serhii Mamontov Avatar answered Nov 11 '22 04:11

Serhii Mamontov