Table View not adjusting to orientation rotation properly - ios

I have a Table View inside of my View, The table view is set to "Scale to Fill" which is how I have been working with these in the past without issue. The problem is that this time around when I have the table view loaded up in portrait mode, it looks and behaves just like a table view should, but when the orientation is rotated to landscape this is what I see:
Instead of the list behaving as it normally would its sticking to a portrait orientation that can still be scrolled, but portrait nevertheless. I need this table to fill around the perimeter of the green box.
I have tried setting the mode to : "Aspect Fit" and "Aspect fill" in storyboards but no luck so far.
How can i fix this issue? Please be as detailed as possible.

I had simply overlooked my autosizing settings for the table view.

Related

One landscape view for whole app

How to setup just one landscape view for whole app? I want to show only one view (qrcode) when phone is rotated independently in wich view this happened. What is the easiest way to do it?
My app is in portrait and I want show users code when it rotated to landscape in whatever view this was done.
See this answer. Just untick Portrait and tick on whatever Landscape orientation you want.
http://stackoverflow.com/a/29791531/7198143
Edit:
You should use Autolayout in your Storyboard to set up the right constraints so even in Landscape mode, the label for the code shows up. See this tutorial for more info.
Autolayout tutorial

UIVisualEffectView changing bounds incorrectly on orientation change

I have a problem that is bugging me like hell. I have a custom view on top of my apps main view for settings configuration. The background of this view uses a UIVisualEffectView. However, my app supports both Portrait and Landscape mode and when changing the orientation, the auto-resizing doesn't work properly for the blur effect.
This is what I mean, changing orientation in the simulator with slow animation set to on (look at whats happens in the bottom of the view):
https://www.dropbox.com/s/bgtx8ygdawkx8be/BlurProblem.mov?dl=0
I have tried setting different content modes and resetting the auto-resizing value, but nothing seems to help.
How can I get the UIVisualEffectView to resize correctly?
Try and set the frame in your viewDidLayoutSubviewsmethod. That way your frame gets set after your view is in place.

iPad - Different designs for landscape and portrait mode

I'm making an application for iPad in Xcode in template Master-detail application. I need to do a design for portrait mode and another for landscape mode. My first idea was make two UIViews and make a rule: if portrait, show View1, if landscape, show View2. But I have text fields in it and when the user will be typing something inside and then rotate the device, text will be deleted, because it will be another UIView... Can anybody help me, how to do it, please?
You can have one view and use springs and struts or use autolayout.
You can also add views and hide/show them based on the orientation change.
You can change the size and position of the view on orientation change.

Xcode Layout Not Appearing Right In Simulator or Real Device

I have a layout working fine in Xcode storyboard for a Master-Detail splitview app but when I run it in the Simulator or on an actual device it appears slightly messed up and I have no idea why.
The image in Xcode looks like this;
The layout in Simulator and Device looks like this
This is almost certainly a problem with the autoresizing settings of your subviews (aka "Springs and Struts").
You are building a UISplitViewController-based application. Note that the dimensions of your Detail View Controller's frame are different when your app is running in portrait vs landscape mode. In your storyboard screenshot above you see the landscape-sized frame. The screen capture from your simulator shows the portrait-size frame. You'll need to set the struts and springs of your subviews (the UIPickerView, the brushed metal buttons, the white box below, etc) so that these elements resize (or not) and maintain their relative (or absolute) position in the parent view.
The easiest way to do this is to set the values in your storyboard, using the Size Inspector in the right column. Select which element you want to change settings for and then look for this:
By clicking on the red arrows inside the inner box you will toggle on/off the "springs", which determine whether your subview expands when the parent view expands, or whether it maintains its original size when that happens. By clicking on the outer red I-bars you will toggle on/off the "struts", which determine whether you subview will maintain a fixed distance from its parent view's edge when the parent view's size changes. Setting the right combination of these will make your view to look correct in both portrait and landscape orientations.
You can also change these settings programmatically in your code by setting the view's autoresizingMask property. See for reference:
http://developer.apple.com/library/ios/DOCUMENTATION/WindowsViews/Conceptual/ViewPG_iPhoneOS/CreatingViews/CreatingViews.html#//apple_ref/doc/uid/TP40009503-CH5-SW5

landscape and portrait in split viewController

I created a split view controller application. I want to display my buttons and controls in landscape and portrait view differently(only the position).
When I change the orientation to landscape it shows the controls in portrait only. When I click on the cell in the tableview then it will show in correct position. What is the reason for that? Help me please.
I am a little confused about your question, but what I think you are trying to ask is how to change your view if the screen is in landscape or portrait orientation. Without seeing your code it is hard to tell you exactly how to do it, but the general idea (at least how I do it in my code) is that you want to split your code into two parts one that is in landscape orientation, and one that is in portrait orientation. You can tell the difference by seeing if the screen height is greater than the screen width.

Resources