My ViewController won't rotate in storyboard, despite being set to landscape. Furthermore the device orientation have been set to only allow landscape. What am i missing?
My guess is that you have "Use Size Classes" selected. Try this link: Enabling Size Classes in Interface Builder
Related
When device turn to landscape, some controls go out of viewController, and I can't drag it to viewController.
Like you can see on your screenshot you have invalid constraints, this can be a problem. If you are using storyboard or xib simple use sizeclass to define specific constraints for portirat and landscape mode. Go and checkout Apple guidelines for adaptive UI https://developer.apple.com/design/adaptivity/
If you are using Storyboard with Autolayouts(constraints),Check once your constraints,Or if you are implementing via coding, You can change frame when device is rotating.
My iPad application is fixed on landscape, and can't be changed during the whole lifetime.
I setup the project as:
and then in storyboard, I set the orientation as the landscape, but I don't know why the view does not change to landscape?
Note: I am using Swift, XCode6.3.2, iOS8.1
In the any | component click on it and mouse over you can see the bottom text said the size of view for iPhone and iPad like following images.
if your application size class desable then that show direct reflaction like old way. but when your app size class enable that need to use with wAny hComponet
if size class enable with landscape:
Same if size class disable with landscape:
If you want to use size class then you need to check viewcontroller preview like following step:
Select view controller and then click on show the assistant editore.
Then you have two part on your xcode like following:
select a preview from following dropdown screenshot:
after select prview you can see the right side one view that is the preview of your viewcontroller view's you can change it landscape or portrait by following.
you can also check with all size by create new preview view by following.
In simulated metrics, you've got the size selected as Inferred. If you want to see what it looks like on a specific device type, select that from the first drop down list.
In the storyboard, the scene is universal so that you can use auto layout to adapt for various devices and orientations.
You can select iPad specifically from the simulated metrics:
Or you can, modify universal storyboard layout from the bottom panel.
Updated answer for Xcode 8 -
Click the View as: text at the bottom of the storyboard.
Is there anyway to rotate the UIViewController displayed on Storyboard as Landscape? By default it displays in a Portrait mode and wondering if there is anyway I can change that?
For iPhone app!
Select UIViewController on storyboard.
tap on Utitlies button at top right corner to show Utilities panel.
Select Attributes Inspector.
Under Simulated Metrics section, you can change Orientation of UIViewController to Landscape.
I am creating an iPad app that is landscape only. I have a main window xib but the window is portrait. When the window is selected and I look at the Simulated Metrics the Orientation shows a dimmed (non selectable) option. In deployment Info landscape Left and Landscape Right are selected. I need landscape so I can design my viewController in landscape.
How can I get the main Window to be in landscape?
In iOS, you do not really use a main window xib, but a storyboard. In the storyboard you can choose "Landscape" from the "Orientation" menu under "Simulated Metrics" without problem when configuring any view controller.
My app supports both portrait and landscape mode. I have a TableViewController that has some issues when i rotate from portrait mode to landscape mode. I want subviews of TableView not to change neither orientation nor size. But i cannot find the way. I tried from storyboard to uncheck Autoresize subviews but it did not work. My TableView is into a TabBarController. It is strange, that in another ViewController i have a similar TableView with exactly the same attributes that works fine. So i added some pics with the problem and with what i want.
The only code that handles TableView orientation changes is in viewDidLoadMethod the below:
self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
The first image is from Portrait mode
The second from troublesome Landscape mode
And the third from the right TableViewController and the result that i want
Any advice would be helpful.
What you can do is setting a constraint on your imageView and force the width and height to stay fixed.
The issue was in size inspector. I had to keep autoresizing of ImageView only TopLeft.