Rounded Corners only on Top of a UIView

后端 未结 10 1964
别跟我提以往
别跟我提以往 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条回答
  •  旧时难觅i
    2020-11-29 23:26

    For iOS11 and later you can use the view's layer property:

    @property CACornerMask maskedCorners
    

    That defines which of the four corners receives the masking when using cornerRadius property. Defaults to all four corners. (Apple doc)

提交回复
热议问题