ios - UILabel alignment to other UILabels -


i have cell prototype i'm trying add 2 labels to. have 2 labels right next each other, size of labels dynamic, want second label able shift depending on size of first label.

basically, want there fixed gap between 2 labels, 2 labels' sizes dynamic.

how do that?

edit:

actually found out how via storyboard. if select 2 labels want have fixed gap between, command select both of them , go corner of storyboard , click pin menu, little 'h' looking thing in group of buttons near zoom in/zoom out in bottom right corner of storyboard screen.

get label size method:

- (cgsize)sizewithfont:(uifont *)font 

https://developer.apple.com/library/ios/#documentation/uikit/reference/nsstring_uikit_additions/reference/reference.html.

then set label's textalignment nstextalignmentleft , nstextalignmentright, , set frames string size , other offset.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -