I have 3 objects in a cell. They are UILable with text (at left), another UILable with text (at right) and a UIButton (at right most). Like:
[[label1_____][label2][button]]
Now how to rearrange these objects after rotating if i want just label1 to stretch and label2 with the button should stay with their original size and right aligned? Like
[[label1__________________][label2][button]]
Is there any align options to align button and label2 right (one by one) and label1 left to make only label1.autoresizingMask = UIViewAutoresizingFlexibleWidth?
I’m trying to do it (fill the cell with subviews) programmatically and I use
[cell.contentView addSubview:subview]
For my left label i did:
label1.autoresizingMask = UIViewAutoresizingFlexibleWidth;
But after rotating from portrait to landscape I get no changes and it looks like:
[[label1_____][label2][button]___________]
Is there any other UIView with property like UIBarButtonSystemItemFlexibleSpace?
In xib , using Interface Builder , use the Autoresizing property for lable and button , the red line’s / Arrow’s for autoresize when change orientation. so set top and rignt line only for second label2 and button.
otherwise , programatically ,
– change the co-ordinate in willAutorotate/shouldAutorotate delegate.
better way ,..using xib.
thanks
Dipak C.