ios - UIButton - text truncated -


i've created wide uibutton interface builder (xcode 4), added in dummy 5 character title (e.g. click) , changed title text programmatically later.

odd thing width of title text seems remain same so, if use longer piece of text (e.g. "now click here"), appears this: "n...e"

any idea what's going on?

update: if use long line of text in ib it's centred. however, once i've programmatically-changed text appears left-aligned!

you need use uibutton method settitle:forstate:

[self.mybutton settitle:@"correct new title" forstate:uicontrolstatenormal]; 

as correctly update size , position of buttons label. setting title self.mybutton.titlelabel.text = @"wrong new title"; not.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -