iPad Split view controller - iphone

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.

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.

How can I restrict modalViewController in Landscape?

I am working on iPad application where I am showing some view in modalView controller.
In Landscape, when I click on UITextField for taking some input modalview controller goes up and keyboard appears.
But I have changed the height of modalViewController and I dont want the modalView goes up for keyboard. How can I do this? Any help?
In the UIViewController's code, where you move its modalViewController, check if the interface orientation is not landscape
if(([self.interfaceOrientation!=UIInterfaceOrientationLandscapeLeft])
&&([self.interfaceOrientation!=UIInterfaceOrientationLandscapeRight]))
//your code to repostion the view controlled by the modalViewController
I guess you have to use custom presentation code. You cannot change the scrollup behaviour, when the keyboard appears.
You could add a 1024*768 sized black transparent view on top of the window and then your view on top of this. But you would have to build your own borders around your view in that case. Probably there are some open-source implementations of a modal popover. You can search for that on cocoacontrols etc.

How can I automatically set the orientation of an iPhone subview?

I'm going in circles here. I have set shouldAutoRotateToInterfaceOrientation for all the view controllers. My app is running correctly in landscape, like this:alt text http://img517.imageshack.us/img517/3749/screenshot20100701at802.png
However, when I add a new subview using [window addSubview:whatever.view]; it shows up like this:alt text http://img291.imageshack.us/img291/3749/screenshot20100701at802.png
How can I make the new subview automatically be added in landscape orientation?
Thanks!
window is probably not managed by one of your view controllers that implement shouldAutoRotateToInterfaceOrientation.
Add your view to one of your view controllers that implement the autorotation.

Landscape UIView in a UITabBarController

I have a UITabbarController with (so far) two navigation controller items. I can get the application to rotate by adding the shouldAutorotateToInterfaceOrientation to each class... but thats not exactly what I want.
What I want to do is to add a button in the UINavigationBar in one of the classes. When this button is pressed I want it to load another view into landscape mode. This view should not show any navigationbar or tabbar controller.
How can I get this to work?
Best regards,
Paul Peelen
You can try to use approach similar to Apple's AlternateViews sample.
Basically you should:
Create your landscape view with appropriate size (480x300 for landscape if standard statusbar is visible)
In your button handler push your landscape calling -pushModalViewController on your current view controller
Apply necessary affine transformation to your view to be displayed correctly in landscape.
Use presentModalViewController:animated: and implement the modal view controller's shouldAutorotateToInterfaceOrientation: accordingly.