Different View for Landscpe and portrait - ios5

I have 2 button .In first button I used separate view for landscape and portrait and for the second button I use only one view for both portrait and landscape. But when I click on button 2, it get load on portrait view then orientation to the landscape mode it load the first buttons landscape mode.

I think u used CGRect class for button1 views.
use separate functions for Landscape mode and portrait mode.
I think this will be useful for you.

Related

iOS StoryBoard with some Portrait views and some Landscape

I have a story board based iPhone application where the majority of the views are in Portrait mode, and should only ever be shown in portrait, due to the nature of the content. But then I have one view which should only ever be in landscape - how can I ensure that views are only displayed in the correct orientation?
I tried adding a second storyboard with the main storyboard set to Portrait orientation and the new storyboard set to landscape but if you launch the landscape view it appears in portrait mode. Can I forcibly rotate the view to landscape in viewWillAppear?
I tried setting the Target's build setting, orientation value to 'Portrait' and 'Landscape Left' but now been my portrait-only storyboard will auto rotate and screw up it's layout.
So, basically, how can I force a view to allow only one particular orientation (portrait for most of view, landscape for just one)?
Only one storyboard will do this. You need to do that ..
1- Go to inspector and select the view and then uncheck the autolayout.
2- Then click on size inspector top right on xcode file.
3- select your controlls one by one and resize them from Left,Right,Top and Bottom.
4- After that run your project.and see what happen....

How to design ui in both portrait and landscape in ios5 using storyboard

How to design ui in both portrait and landscape in interface builder in iphone or ipad (Iam using storyboard not xib..)..
Thanks in advance..
If you want design UI using storyboard, In latest iOS version there is option of Out Layout.
Using Autolayout you can manage UI for both modes.
Hope this will help you
http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2
Or
Other alternate provided on
iPhone Storyboard: different scene for portrait and landscape
When you add a view controller to the storyboard it comes with a view. Call that the container view. Add two views to the container view: a portrait view and a landscape view. Set the dimension of the portrait view and the landscape view appropriately using the size inspector. Add buttons, more views, labels or whatever to the portrait and landscape views as needed for your application. Then when the orientation changes hide one view and show the other.
Hope this will help you out.

iOS6 rotation issue: make my view stick to portrait when pop back from another view controller

I have two viewcontrollers, ViewControllerA supports both landscape and portrait, click a button in ViewControllerA push into ViewControllerB, which supports landscape only, then I make the phone in the landscape direction and then pop back to ViewControllerA, by default A is in landscape mode now, but I want it to be portrait first in this situation. How can I implement that?
In your ViewControllerA's viewwillappear method set the orientation like
[[UIDevice currentDevice]setOrientation:UIInterfaceOrientationPortrait];

Subview Orientation Different from Parent Orientation

My Parent View is in Portrait Mode, but i want my next View to be in Landscape Mode. But i'm unable to achieve this. For making the Next View in Landscape Mode i have to give support to my Parent View as Landscape too which i don't want. Any Suggestions????
Thanks in Advance
In your next view, call
[UIApplication setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft animated:YES]
to set it in landscape orientation.

iPad Split view controller

Is there any way when I rotate an iPad split view app that my view could take up the full screen instead of the menu or resize it? I like the portrait mode with the menu in the button.
How would I go about doing this?
If you're asking if you can hide the master view when a UIScrollView is rotated to landscape orientation, you can't. That's not what UIScrollView is for. You'll have to write your own view controller class.