Make detail side of splitViewController scrollable? - objective-c

I am trying to imbed a scrollView in the detail side of a splitViewController. Should the scrollView be added inside the 'View', as displayed in the image below?
Or does the 'View' need to be removed, leaving a View Controller and a Scroll View only?
Also, when I add the scrollView to the page, the bottom is being cut off, preventing it from scrolling all the way to the bottom. I also tried resizing the scrollView in the ViewDidLoad method of the View Controller to something extremely large such as:
theScrollView.contentSize = CGSizeMake(20000, 20000);
That did not work either. It seems that we can hold down the mouse and pan, but the scroll bars are always the same length. Thanks your help!

I have ALWAYS implemented scrollviews as the UIScrollView with a UIView inside of it, then your other elements (i.e. buttons, text views, etc...) SO the hierarchy would be
UIScrollView
UIView
UILabel
UIButton
.
.
.
Because you dont really have a top UIView WITHIN the scrollview, this is most likely why your
theScrollView.contentSize = CGSizeMake(20000, 20000);
line is not working as intended.

Related

UITableView Inside UIScrollView scrolling issue

In my application I want add a tableview inside a UIScrollView .When the scroll of UITableView reaches the bounce, it should scroll the outer scrollview. But its not happening for me, UITableView is scrolling smoothly.Once it reaches the bounds, it stops. I need the functionality similar to the attached gif .
Please provide some code & you UIScrollView must be smaller than the view.

Scrollview with uiview on top

I have scrollview and on top of it there is a uiview, what I want to do is when i scroll scrollview then top uiview should also get scrolled accordingly. I don't want to put that uiview inside the scrollview due to some reason . but how to make it scrollable even though it is not inside the scrollview.
If you want another view to scroll, it should also be a UIScrollView or a class which inherits it. The UIView itself is not scrollable.
Thus, you could link you background scroll view contentOffset to your front scroll view.
Anyways, your restrictions are strange. If you could be more explicit, someone might provide you a more usefull/simple method to achieve your tasks.
You can listen to the scrollView's contentOffset with KVO, and update your upper UIView's transform accordingly.

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;

UIViews are displayed distorted when I set statusBar to hidden

I have a bunch of UIViews that are displayed on a viewController. They are setup before I call presentModalViewController. The problem is that these views are displayed distorted, specifically they have an extra height of 20, which is the length of the status bar. The problem goes away if I have the statusBar shown or I have the UIViews setup after the viewController is shown, but I need the UIViews to be setup before the viewController is shown and I dont want the statusBar to be shown when my app
is running. How do I fix this?
You can try setting the Autoresize subviews property of the viewController's view to NO.

UITableView Scroll when touch starts on subview

i have a tableview with different kind of cells, one of which has some UITextFields's and UIButton. When i try to scroll this view with the touch starting in any of those subviews the table won't scroll and recognizes it as a 'touch inside' of a subview. I had it before with "delays content touches' but the touch inside button doesn't work well. Any ideas how i might fix this problem?
I just found i had an 'UITapGestureRecognizer' that was creating the problem. thank you for the help
Turning off "Cancellable Content Touches" in the UITableView solved this for me (in the UITableView attributes inspector under Scroll View / Touch). I got this from this SO question: Scrolling a UITableView inside a UIScrollView
From the UIScrollView:canCancelContentTouches doc:
If the value of this property is NO, the scroll view does not scroll regardless of finger movement once the content view starts tracking.