0

SegmentManagingView

I am trying to do something like above link. I set the Rotation code in my segmentmanagingview

But it is not resizing in landscape mode.Table's width is 320 px in landscape and portrait mode.Any other way to achieve this?

1 Answer 1

0

First read Apple's Why won't my UIViewController rotate with the device or the many links on SO to see if rotation is being allowed. Most of the time this will fix it. Other approaches are:

  • Implement didRotateFromInterfaceOrientation and implement a relocation (setting new centers for each view).
  • Duplicate the view and swap the subviews (iterating the subviews and replacing one with the other).
  • Switch views (create a landscape and portrait view on the same nib and change the active view).

There are examples for all three techniques on the iPhone Developer's Cookbook from Erica Sadun. The source code is free to download, look for chapters 2-3.

1
  • - (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { if(toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight ){ [self initWithNibName:@"FollowersView" bundle:nil]; } else if(toInterfaceOrientation == UIInterfaceOrientationPortrait || toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown){ [self initWithNibName:@"FollowersViewController" bundle:nil]; } return YES; } This is not workinng
    – Abhishek
    May 3, 2011 at 12:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.