Custom layout using UICollectionView in Landscape and Portrait - ios

Is there a way to rearrange the cells between portrait and landscape using UICollectionView in a way like the following image? Just to be clear, little square on landscape remains on the left side and the biggest one goes to the right.
EDIT
My problem is that in Landscape mode the big square must occupy and fill two rows

Related

Autolayout : Button side by side in landscape

I am facing a problem in design a view using autolayout where I have four buttons line by line in portrait mode of the device but I want two buttons side by side in landscape orientation. How can I do this?

Rotating the views when the iPad rotates

really new to iPad development here. I made some mockups for what I'm trying to do.
I have a layout like so with options and menu at the bottom. When I rotate to landscape I want to get something like this:
In landscape the menu bar will always be on the right. In portrait always at the bottom. The contents of the square keep their position and rotation regardless of the device orientation.
What would be the rest way of going about this? I have considered removing all the views as the device begins to rotate and then replacing them using new coordinates. Doesn't seem like the animation will be smooth though. I understand how to do constraints, but I want the top square to stick to the tom when portrait and stick to the left when landscape, not always at the top. Any pointers on this would be really appreciated! thank you
This is a job for size classes. They let you define separate layouts for different orientations and would be an ideal solution for your problem. However, for some reason, the difference between iPad portrait and landscape orientation is not directly supported by the the current implementation of size classes.
There is a workaround, Sizing class for iPad portrait and Landscape Modes, that can redefine the meaning of the existing size classes to fit your problem. In other words, you can use the portrait and landscape size classes for the iPhone and re-map them so that they apply to the iPad.
They are selected by a 3x3 grid in Xcode’s Interface Builder. If you play with it a little, it’s easy to grasp the concept.
Here is a screen capture of the control in Interface Builder that lets you switch among your different layouts:

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.

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.

iPad uitableview off position when rotate landscape and portrait

I am developing an iPad GUI with 2 uitableview top and bottom, both occupying half the screen with a navigational controller. when i rotate the view, the table does up and hide behind the navigational controller. when launch it doesn't. it only happens when it rotates. Image 1 shows the table when launch. image 2 shows the columns missing when rotating to landscape. image 3 shows the column missing when shifted back to portrait. is it possible to code a fix position on the screen when portrait and landscape? meaning i set the position when detecting the iPad is in portrait, and landscape.
Override willAnimateRotationToInterfaceOrientation:duration: method in your main view controller, and resize your UITableViews by setting their frames.
See also:
http://developer.apple.com/library/ios/documentation/uikit/reference/UIView_Class/UIView/UIView.html#//apple_ref/occ/instp/UIView/frame
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instm/UIViewController/willRotateToInterfaceOrientation:duration:

Resources