ios - Long name in UIButton shortens -
i have uibutton
has title longer width of button itself. while in uitextfield
see first part of string (which 1 want show) , 3 dots, on uibutton
see first part, towards center 3 dots , third part. there way fix issue without cutting string?
if button size can't change titlelabel size can, can either change font in of button in interface builder or in code or allow label adjust font with:
button.titlelabel.adjustsfontsizetofitwidth = yes;
if button size can change, adjust rather font size:
cgrect frame; frame.origin = self.button.frame.origin; frame.size = [self.button.titlelabel.text sizewithfont:self.button.titlelabel.font]; self.button.frame = frame;
alternatively, if want line break @ end of string instead of middle, similar how uitextfield appears, set linebreakmode
nslinebreakbytruncatingtail
Comments
Post a Comment