iPad SplitView with UiScrollView on it shows bottom half of view in landscape - objective-c

I have a simple iPad app with a UISplitView, I added a UIScrollView to the detail view and everything is fine in portrait orientation. When I go to landscape, the detail view only shows the bottom of the detail view and when I try to scroll to see the top of the view, it springs back down to showing just the bottom half. I am new to this and can't figure out what I am missing.
EDIT: Turning on all 4 Struts of the UIScrollView in IB took care of it.

Turning on all 4 Struts of the UIScrollView in IB took care of it.

Related

How to force a tableView to creep under navigationBar?

I have a tableView that I want to show under the top bar or the navigationBar, I mean to make it start under the top bar as if it was not there, because my navigationBar is transparent. This is basically how they do it lately in the iOS Music app when you are checking an album. Any idea how I can achieve this?
Okay I solved it, uncheck Adjust Scroll View Insets after clicking on your viewController in the Storyboard.

Scroll view doesn't appear in Storyboard

I got an issue,
This morning i just discovered that i can't see the scrollview and all its contents from the storyboard. In the ViewController Scene, the Scroll view is like transparent, as you can see in the below screen.
The app is still working well in the simulator and i have no warnings
Any idea?
thanks in advance

UINavigationViewController changes the behaviour of scroll view in iOS7

I have a 'UIScrollView' that is supposed to display a list of images one next to the other. This is the code I'm using to add each image:
#define SCROLL_PADDING 10
#define SCROLL_DIMENSIONS 50
view.frame = CGRectMake(xValue, SCROLL_PADDING, SCROLL_DIMENSIONS, SCROLL_DIMENSIONS);
[scroller addSubview:view];
However, as shown in the image below, the images are loaded with a vertical offset. After some research I realised that this offset is the same as the height of the navigation bar's height.
Note 1: By default the images cannot be seen. I had to scroll up to make them visible.
Note 2: I shouldn't be able to scroll because the images should fit in the scroll view.
I decided to present the view controller modally instead of pushing it to the hierarchy of the navigation view controller and everything work as expected.
This problem only happens in iOS7. Any ideas why?
I came across this article, which clearly explains various changes in status bars and navigation bars on iOS7
As you can see in both of the images above, the position of the scroll view doesn't change. In iOS6 if the subview's frame doesn't change, it would be moved down to prevent it from underlapping the navigation bar. Since iOS7 it is expected that all subviews will underlap not only the navigation bar but also the status bar, which makes the location (0, 0) the top left of the SCREEN.
For some reason that I don't understand yet (it would be nice if somebody could explain), only the scroll view's subviews where moved down in the same way it was being done in iOS6. Hence making the subviews appear out of the scroll view's bounds.
To prevent the subviews from underlapping the navigation bar it is necessary to set edgesForExtendedLayour to UIRectEdgeNone as early as possible in the life cycle of the view controller
viewController.edgesForExtendedLayout = UIRectEdgeNone;

UIBarButtonItems are randomly resizing in bottom UIToolBar

I added a UIToolbar on the bottom a view controller in IB.
I added a few UIBarButtonItems, but it seems to randomly resize either when I click on one of the UIBarButtons or if I leave the view and come back to it.
Is there any reason why it is doing this? I didn't have this issue when I was running iOS6, but on iOS7, xCode 5 the words shrink and expand randomly.
Is there anyway to lock the size or fix this issue?
Thanks!

xcode adding button to uitabbarcontroller is not clickable on landscape

I am adding a simple button into a view on a tabbarcontroller to the bottom right of the view. This button is clickable only when it is on portrait, not when the app is flipped to landscape. The app is using autolayout, so I've added two constraints so it hugs the bottom right of the view on landscape and portrait. Horizontal space at 20 and Vertical space at 24. I've tried this on a UIViewController without the UITabBarController, and it works perfectly. But once the view is added to a tab, it stops working. How do I get this button clickable on both portrait and landscape?
This seems like a very simple setup, but I have no idea why this does not work.
![snapshot2]http://ownits-stackoverflow.s3.amazonaws.com/snapshot2.png
![snapshot3]http://ownits-stackoverflow.s3.amazonaws.com/snapshot3.png
I tried the same thing it works. Here is the sample code try to run it on your own simulator and on device.
Sample Project