Just struggled with this - here is my solution:
IOS doesn't have the concept of a โstream layout,โ so you need to calculate the width of each control manually and place them absolutely in the parent container. UILabels are slightly different from buttons, since the only way to determine the size of the content is by using the [NSString sizeWithFont:...] method. See here for an example.
In your case, you will need to listen when user interaction is completed depending on which item is changing, and use [UIView setNeedsDisplay] (http://developer.apple.com/library/ios/#documentation/UIKit/Reference/ UIView_Class / UIView / UIView.html # // apple_ref / occ / instm / UIView / setNeedsDisplay) to redraw the view and routines.
This is much more complicated than necessary, IMHO.
source share