Swift - UIButton with two lines of text

前端 未结 10 1677
离开以前
离开以前 2020-11-30 23:38

I was wondering if it is possible to create a UIButton with two lines of text. I need each line to have a different font size. The first line will be 17 point and the seco

10条回答
  •  难免孤独
    2020-12-01 00:41

    I have fixed this and my solution it was only in the Storyboard.

    Changes:

    It added in Identity Inspector -> User Defined Runtime Attributes (these KeyPaths):

    • numberOfLines = 2
    • titleLabel.textAlignment = 1

    User Defined Runtime Attributes

    I added this in attributes inspector:

    • line break = word wrap

    Word wrap

提交回复
热议问题