Make UIScrollView scroll from scrolling inside OR outside of it - ios

Say I have a UIScrollView that scrolls horizontally just fine. It's height is around 50px. After usability testing, a lot of people are trying to scroll the contents by panning outside of it. Here is the setup:
Where it says "Amount" is the scrollview
I am wondering if it is possible to attach a UIPanGestureRecognizer on the blurred background it sits on top of and have it scroll along with that as well. If this is possible, could someone give me a start on what that approach would possibly look like?

Nah, the simple solution is simply make the scroll view bigger .. it's just that simple.
Have it mostly transparent, with your content sitting where you want it.
What you describe in your question is a good idea but it's extremely! hard to really implement well, a total pain. You simply "make the scroll view bigger".
Nice looking app.
These may be relevant to you...
The UICollectionView "swipe-away" in iOS7 app manager?
Show/hide UIToolbar, "match finger movement", precisely as in for example iOS7 Safari

Related

How to pin an image/view inside a UIScrollView when scrolling

I've been searching for a way to pin views/images to the top of a UIScrollView when scrolling. However the posts/articles I came across are not in swift 3. I'm not sure if I'm typing my question in the web correctly. So my question is how can we achieve the same behavior as a UITableView or UICollectionView. When you scroll, a section will stick to the top until another section pushes it up. I'm wondering would we be able to use views/image and pin them at the top of the UIScrollView. Down below is a screenshot of a UIScrollView that has 4 views.
So when scrolling I would like to pin the first view/image to the top until another view/image pushes it. Also would it be possible to determine which view sticks to the top. So lets say I only want the red views to stick until another red view pushes it. Been looking for a way to achieve this type of behavior for a while now.
Please help, would really appreciate any help provided at this point. Thanks.
A few ways to do this, but you can use the scrollView delegate’s scrollViewDidScroll to capture the contentOffset and use a combination of the target view’s origin/center/transform properties to keep the view where you want it.
There’s a neat video explaining how to do this that Apple released during WWDC 2010, called something like “Advanced Scroll View Behavior”, if I remember correctly. It’s definitely worth a watch.

iOS (iPhone only): Horizontal page scroll, where the scrolling page doesn't take up the whole screen

I am trying to achieve horizontal page scrolling effect (partial view, not of the entire screen scrolling), like in the HGPageScrollView component.
I am a fairly novice iOS programmer, and I am having difficulty finding the parts of the code which provide just the horizontal scrolling with the swipe gesture. So I am looking for any help, either some sample code, or pointers to the code in the HGPageScrollView, which provide just the horizontal scrolling functionality (i.e. not even the UIPageControl dots at the bottom, just the vanilla scroll).
I am only looking for an implementation which works in iPhone landscape orientation, if that makes it any easier.
Why I am not using HGPageScrollView:
It is not ARC compliant.
It does way more than I need it to, I am just looking for the scrolling.
Consequently, it is proving quite difficult for me to find where to remove all the features I do not need, like clicking on page to change the scrolling mode to full screen (HGPageScrollViewModePage)
I would like to use this as an incentive to learn more about the components available in cocoa-touch, and roll my own implementation.
I think this question might be suggesting the solution, but I do not know how to implement it. I guess I don't fully understand it, as there aren't enough details for my novice skills to go on.
Use a UICollectionView and set the pagingEnabled property to YES.
If you want to do complex layouts of the items (like in your example above where items are split on both sides of the screen) you may want to provide your on UICollectionViewLayout: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UICollectionViewLayout_class/Reference/Reference.html#//apple_ref/occ/cl/UICollectionViewLayout

iOS UIScrollView fine tuning

In Apple's apps I notice the scrolling is perfect. Everything moves nicely and when you stop, it stops. You can have a huge image and move directly to any spot and it stays there.
I'd like to provide the same UE, but for my apps, if the content exceeds the size of the scroll view (as it should - otherwise what's the point in having a scroll view?) the scroll view never stays put, you have to drag to see content on the edges, then it bounces back and hides it again. Very annoying, especially if there is active content like a button there.
I'm not an iOS expert, e.g. I just found out recently about how critical viewWillAppear is w.r.t. UIScrollView. Is there a concise reference somewhere on how to get perfect rock solid scrolling? (i.e. not Apple's Dev docs!)
Thanks for reading,
Yimin
Are you setting the contentSize property on the UIScrollView?
scrollView.contentSize = CGSizeMake(2000, 2000);
Apple has access to internals which we don't so its products tend to perform better. Scrolling in iOS is basically take it or leave it. Have followed the guidelines in the tutorials and they all have flakey scrolling, in particular the edges aren't always visible when zoomed.

How to change the scrollable area of UITableView?

I think it'd be a good start to take a look at the wireframe I'm implementing: http://imgur.com/J8Kgy
So this is a special table view, and the background image is much bigger than the table area. And what I want is to have the background scrollable and have the table stick to a specific position on the background, and the table moves together with the background.
EDIT: Besides, this position may change over some time.
I found it hard to do by extending UITableView since I didn't find the way to change the scrollable area and actually I didn't find how to access the view containing all the rows so I don't know how to position it.
Currently I'm doing this with a UITableView in a UIScrollView but I think that's a waste since UITableView is already a UIScrollView itself.
So anyone knows it's possible to change the scrollable area to the whole background and how to access the rows' container? Or it's not possible? If it's not possible it'd be easier to just make a simple list view by myself and get rid of UITableView I think.
Thanks!
Pine

Fluid full screen view transitions on iOS

I have a simple app that has a set of coloured views, one red, one green and one blue.
I am trying to make it so that when a swipe gesture is made the current view will switch to the next one in the list in a fluid manner, it looks like moving a long piece of paper with different colours on it.
Is there a way to do this (CoreAnimation)?
You could first look into UIScrollView. It seems to me that what you are trying to accomplish is the same you have, say, in Mobile Safari on an iPhone, when you show all your current pages and can go from one to the next by scrolling. This tutorial is particularly close to what you describe.
If you are looking into more advanced kind of transformations, than Core Animation would be the option.
Actually, nothing prevents using both approaches, UIScrollView to handle the swipe, Core Animation to add more animation to the pack...
You could use a UIScrollView to accomplish this. Add all of your colored views as subviews to the scroll view. Make sure your contentSize is setup appropriately and optionally setup paging to make the scrolling always snap to a certain border. See the scroll view programming guide for more info Scroll View Programming Guide

Resources