i have text can of variable length. want adjust size of button show text. times text , in cases want limit size width. how can uibutton.
above text way long. want show maybe 40 characters.
i trying use range , following:
final result:
using autolayout, add width constraint, set width constraint's relation 'less or equal' constant (max width). uibutton should auto resize fit text till max long not have fixed width constraint or spacing constraint.
update: work different screen sizes, instead of adding width constraint, add trailing space (right side) constraint superview (for example). set 'more or equal' maybe 20pts. means spacing adjust large possible without going off screen (width autoresized fit text).
Comments
Post a Comment