swift - UIButton's textLabel not being clipped -


i have uibutton,and set text this:

let mybutton ... mybutton.textlabel?.text = "abcdefghijklmn" 

but when run ,the text clipped. how uibutton auto resize fit inner text.

here screenshot.

enter image description here

what want this:

abcdefghijklmn

option a: mybutton.sizetofit()

option b: use layout constraints don't constrict label's width


Comments

Popular posts from this blog

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -