I am using the Interface Builder to create this UI:
And when it is in portrait the One and Two TextViews fill the width of the screen (which is what I want), but when I rotate it to landscape mode the TextViews do not take up the full width of the screen.
How can I get the TextViews to fill the width of the screen in landscape mode? In the Interface Builder, the "Autolayout" option is checked and if possible I would like to accomplish this with it still checked since everything else works best with it on. Any advice would be greatly appreciated since I am still fairly new to iOS programming.
Now the screenshots are posted below. If you notice text box One for example goes all the way to the edge in Portrait view, but not in Landscape view.
If you dont want to use AutoLayout, You can use following steps.
1) In your XIB uncheck autoLayout check box.
2) Select your TextField and set autoResizeConstraints as follows.
Tyr this .... It will help you....
You can either change the textView size programmatically when t change to landscape in the method
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
Select your UITextView and press the "Pin" button.
Click the left and right constraints so they turn from dotted light red to red.
Enter your required distance from the superview. In my example, 5 pixels.
Remember, these two constraints are not enough to define a position of the UITextView.
To do this you must either:
Pin the view to either the top or bottom and provide a height
constraint.
Pin the view to both the top or bottom
Center the view vertically in the container
Align the view with some other subview that has a resolvable Y
position