UIButton titleLabel frame size returning CGSize with zero width & height

前端 未结 6 457
执笔经年
执笔经年 2021-02-01 23:16

For iOS7, I used the UIButton titleLabel.frame.size.width property to determine the width of my button title under different localisations so I could p

6条回答
  •  面向向阳花
    2021-02-01 23:45

    Turns out I had greatly over engineered myself into this problem. I took out all of my content inset code and therefore didn't need to find the frame.size. I now just centre the button titles and all is well!

    Still seems there is an issue with getting the frame.size but for my needs, I can work around it.

提交回复
热议问题