I have a custom UISegmentedControl that I placed using IB into a Navigation bar much like it is done in the iTunes App. When the device is rotated in landscape mode, I want to repopulate the segmented control to make use of the more space I have there.
I do:
CGFloat controlWidth = self.frame.size.width;
where self is the custom UISegmentedControl but that always returns 310 as the width.
Now in both code I also set the following resizing mask:
self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
which actually makes the segmented control expand properly.
Any suggestions?