I have a very simple iOS App (Xcode 8, SWIFT 3), containing a UILabel. It appears some way down the screen when in portrait orientation (Regular, Compact) when using Interface Builder for iPhone 6s. When I rotate to Landscape (Compact, Compact), I cannot get any combination of layouts to move this control to the right-hand half of the landscape view. There is plenty of room for it, but I just cannot work out how to achieve it. I just want it (and a few other controls) to appear in a different place when in Landscape view.
Related
Hello stackoverflow community,
I have just added the constraints to my iPad app and would now like that if you hold the iPad across that you can scroll the page, because not everything fits on a transverse page. If the Ipad is upright you should not be able to scroll (there everything fits).
How can I make that happen?
Edit:
I would like to be able to use landscape mode on my app, which I originally designed to be portrait only. For this I have already inserted all constraints so that the size etc. fits. Now, however, the page is so full that it no longer fits on the complete display in landscape mode. Now I would like to be able to scroll down and thus the complete page is on the display. How it looks at the moment in portrait and landscape format I have loaded into the attachment (do not wonder the app is in German).
Landscape
Portrait
add your views into UIScrollView and set its contentsize, you can thencontrol what should be visible or scrollable for both portrait and landscape
I have an iPad app that is written for Portrait mode; I am trying to add Landscape mode to it using Auto Layout. Everything appears to work just by changing the Size Classes in XCode, except some of the pages are longer when displayed in Landscape mode. My thoughts are to just add a UIScrollView to each page that needs it, at the top of the view hierarchy.
Is this the preferred method of solving this issue?
Yes, when designing an app for both landscape and portrait orientations you usually will need to make the content scrollable in landscape orientation.
You can also create a different layout for the landscape orientation and completely re-layout the UI components when the app rotates, but for simplicity putting all of your objects in a scroll view will solve your issue of limited real estate on the screen.
I am using adaptive layout with size classes (iOS10).
For an iPad I want to support portrait & landscape views, but for iPhone I only want to support portrait. I don't want to rotate screen for compact height.
iPad is all fine and I have set-up the iPhone views using size classes, so I am thinking I need to somehow detect what size class will be transitioned to and disable rotation if it would go to compact height.
I can see a method called traitCollectionDidChange, but not sure if this is the correct time in the lifecycle to detect this.
There are a few related questions, but I don't see anything that covers this specific scenario.
How Can I make some of my UIViews to be orientation independent and some of them dependent. I'm looking for effect similar to this in standard iOS 9 Camera App when user change orientation from Portrait to Landscape. In Camera View Controller only left Icons and Right Icons are rotating but the internal view stays on position independently.
I have a Xamarin iOS app that is created with a storyboard. The storyboard is set to view as iPhone 5. I have a webview as below that fits the screen fine. When run on an iPhone 6 plus, it seems to grow fine and fills the entire iphone 6 plus screen. However when used on an iphone 4, a web page will fall off the bottom of the screen... which indicates to me that the webview is too big.
I don't know why it seems to scale up but not down. I need the bottom of the webview to always pin to the bottom of the screen. How can I do this? I have tried the UI constraint icons but they never seem to work as expected. Can this just be done in code instead? Even in iOS objective-c would help as I can convert it to c#.
Any pointers would be great!!
It works on iPhone 5 and the 6 versions because iPhone6/6+ uses a compatibility mode. Resolution of iPhone 4 is smaller. Try single clicking the web view to switch to constraint mode (you'll see T and H shaped handles).
Drag the T shaped ones to the top, left, right and bottom border of the view controller's view. That will constrain height and with to the parent view's size.