How Can I Underline the Button Text of UIButton?

后端 未结 4 1913
既然无缘
既然无缘 2021-02-03 14:09

The text is coming form a database. I would like to use it for a button and underline the text of the button. How can I do that?

4条回答
  •  猫巷女王i
    2021-02-03 14:33

    To make this a bit simpler (it's a common requirement) I've built a simple UIButton subclass called BVUnderlineButton that you can drop straight into your projects.

    It's on Github at https://github.com/benvium/BVUnderlineButton (MIT licence).

    You can use it in a XIB / Storyboard or direct via code.

提交回复
热议问题