Change UIButton BorderColor in Storyboard

后端 未结 7 1344
南笙
南笙 2020-12-12 14:31

I Set CornerRadius and BorderWidth for UIbutton in User Defined Runtime Attributes. Without adding layer.borderColor it works Well and Display border in bla

7条回答
  •  一个人的身影
    2020-12-12 15:21

    There is a much better way to do this! You should use @IBInspectable. Check out Mike Woelmer's blog entry here: https://spin.atomicobject.com/2017/07/18/swift-interface-builder/

    It actually adds the feature to IB in Xcode! Some of the screenshots in other answers make it appear as though the fields exist in IB, but at least in Xcode 9 they do not. But following his post will add them.

提交回复
热议问题