Setting masked corners in Interface Builder

前端 未结 2 1941
我寻月下人不归
我寻月下人不归 2021-02-14 13:09

What type of value is [.layerMaxXMinYCorner, .layerMinXMinYCorner]? Is it possible to set this parameter on a View in Interface Builder? I know how to set lay

相关标签:
2条回答
  • 2021-02-14 13:51

    maskedCorners is a CACornerMask, which is an OptionSet, or bit mask. The raw value is an integer: in code, you can try printing the value of someView.layer.maskedCorners.rawValue, or setting it via someView.layer.maskedCorners.setValue(3, forKey: "maskedCorners").

    So you should be able to set the value of layer.maskedCorners to the integer 3 (or whatever you need) in Interface Builder, and I don't see why it would be unsafe to do this. Though it will be a pain to figure out what set of corners that integer value actually maps to if you forget.

    0 讨论(0)
  • 2021-02-14 13:58

    Did not check if it works, but you may try c:

    (Don't forget to apply the mask to your view

    0 讨论(0)
提交回复
热议问题