Rounded Corners only on Top of a UIView

后端 未结 10 1963
别跟我提以往
别跟我提以往 2020-11-29 22:53

Hi i am searching a clean solution without overwriting drawRect or stuff like that to create a UIView with Rounded corners on the Top of the

10条回答
  •  误落风尘
    2020-11-29 23:38

    In Objective-C it looks like:

    [oCollectionViewCell.layer setMasksToBounds:YES];
    [oCollectionViewCell.layer setCornerRadius:5.0];
    [oCollectionViewCell.layer setMaskedCorners:kCALayerMinXMinYCorner|kCALayerMaxXMinYCorner];
    

提交回复
热议问题