I am working on a app that requires scrolling implemented in Our Choice iPad app from Push Pop Press.
Has anyone implemented the nested scrolling like that?
Updated:
There are two scroll views, one on top with paging and another at the bottom. The top one specifies the Chapters and bottom one corresponds to the pages in the chapter.
So when you swipe to next page of top scroller the bottom one moves accordingly to show it pages. And you can scroll bottom scrollview to view the pages on it. Also when you are at the last few pages of the bottom scroll view and try to scroll then it changes the page at the top scroll view and update the bottom scroll view as well.
Here is the demo video of the app
http://vimeo.com/22872218
Related
I am implementing a scroll view which consists of an image underneath it is a collection view.
What I want to do is a smooth scrolling between the page as if the collection view is just elements in the scroll view.
But what happens is the when I scroll, the collection view needs to be dragged twice to exit it or to enter it.
What I mean is that when the scroll view first appears there is an image and under it is collection view. when I scroll down if I touch the image, the scroll is done correctly, however, if I touch the view the image is still here and a small scroll is done then when I scroll again the scroll is done right and the collection view takes the whole screen
After that when I scroll upwards, the same happens a small scroll happens then I have to touch again to do the scroll right and show the image.
EDIT: This GIF shows would clarify what I mean :
https://im2.ezgif.com/tmp/ezgif-2-75ed33ccd665.gif
Edit: The best solution was to create a TableView/CollectionView header and and my header in it and scroll normally for the table/collection view.
Old solution
The solution as provided in a comment by #MayurKarmur was to disable the scrolling in the collection view and adding height to collection view according to its content.
I need some help figuring this out.
I have a simple UI I need to implement. I have 4 buttons that take up the entire screen and with the scrollview, I want the user to be able to scroll to make the 5th button visible. I know how to use auto layout to make my first four buttons display how I want them. The first button is 40% of the visible screen, the second button is 15%, the third 30% and the last button is 15% of the visible screen. The 5th button should be hidden but then revealed when the user scrolls down.
(To clarify, all buttons have width equal to their superview, proportional height to the superview and all buttons have no spacing between each other)
This is where I am stuck. I want the proportions as I stated above, but also want the 5th button to show when scrolled to, possibly at 10% of the now visible screen (with the first button now not showing itself fully). Is there a way to do this?
You can set the contentSize of the UIScrollView to be larger than the visible screen. The buttons can be sized and placed in a way to have all 5 buttons visible (with the 5th button actually off screen). The scrollView will bring the 5th button into view when scrolling.
I worked up a simple prototype using just a storyboard (and setting the contentSize of the scrollview in Runtime Attributes section, but this could be done in code if you need to pragmatically determine the button sizes.
I ma using UIWebView to some html content. And some time the data is more in width or height but I have fixed size UIWebView. So for user perspective I want to show scroller vertical or horizontal to indicate the user that there are some more content are available in this view. I am using
[webView.scrollView flashScrollIndicators];
but it show scroller when I touch UIWebView. I want to show scroller by default. Can you suggest how to do this.
Use the scroll view of the webviw like this:
[(YOUR WEBVIEW).scrollView setShowsHorizontalScrollIndicator:YES];
[(YOUR WEBVIEW)scrollView setShowsVerticalScrollIndicator:YES];
You can do one thing that ,use this
- (void) webViewDidFinishLoad:(UIWebView *)webView){
[(YOUR WEBVIEW).scrollView flashScrollIndicators];
}
It Will show the scroll-indicator when downloading of the content will finish and user will easily understand that , there are more content on the bottom of the page.
The answer here is simple - you can't as it is against the human interface guidelines. There is a reason that the only way you can manually get them to show is by calling flashScrollIndicators. Apple didn't intend for you to show them so if you're going to implement this, it's going to be the hard way (subclassing or creating your own UIWebView).
Appearance and Behavior
When a scroll view first appears—or when users interact with it—vertical or horizontal scroll indicators flash briefly to show users that there is more content they can reveal. Other than the transient scroll indicators, a scroll view has no predefined appearance.
A scroll view responds to the speed and direction of gestures to reveal content in a way that feels natural to people. When users drag content in a scroll view, the content follows the touch; when users flick content, the scroll view reveals the content quickly and stops scrolling when the user touches the screen or when the end of the content is reached. A scroll view can also operate in paging mode, in which each drag or flick gesture reveals one app-defined page of content.
Source - iOS UI Element Usage Guidelines
i am creating an app which has two UIImageViews at top and bottom of the screen and few customs buttons in between them which i am using in a UIScrollview so that user can scroll through them while the two images remain on top & bottom as they are.But when i use the scrollview the buttons scroll over the two UIimageview instead of just scrolling between them or hiding behind them as users scroll down..how can i make the UIImagviews remain on top of the buttons in UIScrollview??
I assume that you use the Interface Builder...
Make sure that:
The frame of the scroll view is between the image view
The Clip subviews of the scroll view is checked
The image views appear after the scroll view in the views hierarchy (if not then you can just drag them inside the hierarchy)
I have a view with half a dozen text fields and labels, and a button.
I want it to be that when the keyboard pops up, the view becomes scrollable, so you can scroll the view up and see the bottom half of the fields without having to dismiss the keyboard to get to them.
Just putting it inside a UIScrollView doesn't seem to do it.
You have to set the scroll view's contentSize to enable scrolling.