Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Status
Not open for further replies.

cthesky

macrumors member
Original poster
Aug 21, 2011
91
0
Hi all,

I am developing an IPad application. In my IPad application, all the views must portrait and landscape supported. I found out a way to make the views can autorotate that is set the shouldAutorotateToInterfaceOrientation method return YES. So, now all the views in my application can be autorotate based on device orientation. But it appear many problems ... ...

One of the problem I need to clarify is when the IPad device rotate to landscape, I saw the status bar can aligned to landscape nicely but the view is just appear as rectangle with right side cut-off. I think may be this is view autoresize problem... So I set the Autosizing property in Interface Builder under Size Inspector with UIViewAutoresizingFlexibleWidth and UIViewAutoresizingFlexibleHeight selected. But this still didn't solve my problem... and this problem happens for all views except root view, so I wondering is it possible caused by the views hierachy of my application does not organised well? And this problem does not appear when I run in IPad Simulator.

After a few days research, I found out some solution, but this is my first time develop IPad application, I don't know what I do is corrrect or not... Hope someone can give me some ideas... I have listed the solutions as below:

1.) When I display all the views using -(void)presentModalViewController: (UIViewController *)modalViewController animated: (BOOL)animated, all the views can autoresize properly when I rotate my IPad device to landscape. But when I display them using - (void)addSubview: (UIView *)view, the problem happens again...

2.) Reset the frame size based on the status bar orientation in ViewDidLoad method. But is it a correct solution since I need to reset frame size for every views in my application every time they loaded?

So, is it the correct way to solve the problem?

I really need some advice and opinion to solve this problem ... Any comments are welcome. Thanks a lot :)
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.