How to fix the orientation issue in IOS 7 - ios

Orientation problem is present across the app. All the views looks fine in portrait mode.
But When orientation changes to landscape mode the subviews are rearranged.
I am using buttons and labels on the view. How to fix the orientation issue so that view for portrait and landscape looks same?

You can do this with springs and struts or using autolayout.
Please refer these wonderful tutorials for getting a hangout of autlayout and its advantage over springs and struts :
Beginning Auto Layout Tutorial in iOS 7: Part 1
Beginning Auto Layout Tutorial in iOS 7: Part 2
Feel free to comment below if you have any doubts regarding the same.
Hope this helps! :)

Related

iOS change design orientation in storyboard

I want to make a design that works on both portrait and landscape. I am doing my design in storyboard. Say, for signup view controller the design is working on portrait mode. But I can't make the design in landscape. I googled for couple of hours, but I can't get any tutorial from where I can move ahead.
Can any one please help me?
Use autolayouts for that. Here are some tutorials:
http://www.raywenderlich.com/115440/auto-layout-tutorial-in-ios-9-part-1-getting-started-2
http://www.raywenderlich.com/115444/auto-layout-tutorial-in-ios-9-part-2-constraints
Please note, for working your app in both orientations, enable portrait and landscape modes in General Settings->Device Orientation.

IOS 8 Adaptive Layout. Different Layout for ipad orientation

Can some one please give me some idea of how to use universal storyboard to show different layouts for iPad portrait and landscape.
Not possible at the moment. I have filed a bug report as wanting a new feature to be added to make it possible. I'll keep you updated.

iOS: Portrait & Landsacpe without adjusting programatically

Am creating an screen that supports both landscape & portrait
While am changing the orientation it miss match the design
Is there any way to adjust the screen without adding any code to adjust.
Because am using an dynamic project.
Screenshot: This is the way am set orientation for whole app in plist
Any solution please. Thanks in advance.
You should use Auto Layout feature (from iOS 6.0).
Take a look at:
http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2
You can use Auto Layout if you support iOS 6 and later, or you could simply use the Autoresizing Masks for earlier versions.
Auto Layout allows you to do complex layouts for most scenarios, but in some cases you'll still need to programatically adjust the constraints.
Check this out for more information on how to get started: https://developer.apple.com/library/ios/documentation/userexperience/conceptual/AutolayoutPG/Introduction/Introduction.html

Using autolayout for different positioning Portrait vs Landscape

I'm very new to Autolayout. I'm building an iOS 7 app with Xcode 5 and I want realize a login page that appears in a way in Portrait and in another way in Landscape.
This is what I want:
The problem is that I have problem to set the elements in different position for Portrait among Landscape.
Without using autolayout, this is very easy by using hard coded position programmatically, but I want use autolayout.
Can anyone explain me how to achieve this ?
I also read the Ray Wenderlich tutorial, but doesn't explain a case similar to mine.
And I also read this post.
Thanks.

UIViewController Size doesn´t work

Hi im currently developing an Universal app for iPhone, iPod and iPad. I have all view controllers in both storyboards set to Inferred. It works fine on iPhone Retina and on all iPads but when you put it in landscape mode it gets all messed upp and on the iphone 3,5 inch simulator the bottom gets cut off. How can i fix this? Do i have do create seperate view controllers for landscape mode and iphone 3,5? And the write some code that recognizes if its in landscape mode and iphone 4? I thought this worked automatically. Or have i done something wrong?
There is no quick fix/answer to your question.
Since the screen size is different while using horizontal and vertical orientations - it is simply not the same canvas and thus you will need to do some manual work to set it right.
Strategy 1.
Assuming your layout is simple - there are not too many elements and all elements can theoretically fit both horizontal and vertical screen size:
You should use auto layout from the Interface builder - Look at an excellent video from WWDC
https://developer.apple.com/wwdc/videos/
(video 406 - Taking Control of Auto Layout in Xcode 5)
In few words - you set spacers to your elements, aligning them to the end of your view (dynamically), therefore you can make your element shrink and move automatically respecting the current screen orientation.
Strategy 2.
Assuming your UI is complex and will not fit both orientations:
have a different xib file for horizontal and vertical views, this can take some time, but it is a solid solution that always looks good.
You simply need to track changes in orientation and load the appropriate xib.
Your problem will only be solved if you use Autolayouting and for that you need to go through some tutorials
Ray's Tutorial
Another Very well explained tutorial
Going through the above articles will definately help you in solving your problem

Resources