Monday, 15 August 2011

ios - How to align and move two labels programmatically? -



ios - How to align and move two labels programmatically? -

i have utilize 2 sequential label, like:

title: new title

but title localized string alter length in different languages. how programmatically move uilabel of new title @ end of title ? autolayout old solutions found on stackoverflow don't seem working.

use 1 string

nsstring *str = [nsstring stringwithformat:@"title:%@ newtitle:%@", title, newtitle];

if color of title , text different utilize attributed string illustration -

nsmutableattributedstring *str = [[nsmutableattributedstring alloc] initwithstring:@"its test attributed string."]; [str addattribute:nsbackgroundcolorattributename value:[uicolor yellowcolor] range:nsmakerange(3,5)]; [str addattribute:nsforegroundcolorattributename value:[uicolor greencolor] range:nsmakerange(10,7)]; [str addattribute:nsfontattributename value:[uifont fontwithname:@"helveticaneue-bold" size:20.0] range:nsmakerange(20, 10)];

ios iphone uilabel

No comments:

Post a Comment