I would like to build an iPhone App that uses a horizontal scroll similar to this:
(source: tappgala.com)
Do i have to use a UIScrollView and work on it, are there some UI Components that make this job or are there better ways to obtain the result?
Touch-based scrolling behaviour is best achieved with a UIScrollView, but if you only want to switch between pages of content in response to taps (i. e. what a UITabViewController does) then you're perfectly fine with programmatically swapping views.
Related
I'm trying to have a horizontally scrolling UIScrollView with horizontal paging (kinda like a UIPageController but managed by a single UIViewController)
Because I'm using Auto Layout I have set up everything by using constraints for the views inside, and the scrollview works just fine. However what is odd is that the paging works in a weird way.
Specifically the scrolling becomes really slow and it takes over 5 seconds for the scroll view to snap in place.
I am absolutely puzzled by this because I have done this before with a smaller view (about three "pages" as opposed to 6) and it worked flawlessly.
I have created a sample project to illustrate this; just build it and try scrolling left and right - it works best if you just flick once.
http://mbx.cm/t/MmLIi
The only thing that seems to prevent this is having the viewcontroller manage the scrollview directly (as opposed to have it inside a UIView), but I'm sure the problem lies elsewhere so I figured I'd try my luck to see if any Auto Layout gurus can help me out on this one.
All I did was change your view controller's "Simulated Size" to "Fixed" instead of "Freeform" in the storyboard and it worked fine after that. Not really sure why that would change anything, but it did!
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
I want to embed UIScrollViews in my UITableViewCells in order to accomplish the iOS 7 cell sliding paradigm (seen in Mail.app among others).
I normally set up the entirety of my app in Storyboards and use Auto Layout. UIScrollView is unfortunately very annoying to use in conjunction with Auto Layout, so I guess I'm going to have to avoid using it.
What's my best course of action for using UIScrollView with a Storyboard that uses Auto Layout? (I need the scroll view to adapt to a landscape orientation switch, something that would be very easy with Auto Layout.) I still would like to use Storyboards, and need to position the scroll views, but as I can't just switch to strings and struts for one view, and Auto Layout is out, I'm rather stuck.
Should I create its size in portrait, not set any constraints, and then in viewDidLoad set some auto-resizing masks? Or is it only zooming that UIScrollViews and Auto Layout conflict over, and simple panning should be fine?
See http://www.teehanlax.com/blog/reproducing-the-ios-7-mail-apps-interface/ and an implementation using autolayout at https://github.com/Jafared/JASwipeCellExperiment.
Courtesy of jafar's comment on Swipe to Delete and the "More" button (like in Mail app on iOS 7).
I'm developing a iPad app which is just a series of pictures, and I'm stuck. I've managed to link up a Tab Bar Contoller to the 6 View Controllers and all seems to work well. But I'd like to be able swipe to the next View Controller once the user has selected the button. How do I do this? The swipe gestures don't work for me. Here's a snapshot:
I think you are looking for UIPageController. This is the control that is used in the iPhone Weather app to allow you to swipe from city to city. Go here to see the full documentation on the control.
That's not usually how Tab Bars work in iOS, but…
What it sounds like you're after is either a UIScrollView with paging enabled (keep in mind you'll have to set the scroll view's ContentSize) or a UIPageViewController (if you don't want to deal with sizing explicitly and you're OK making a new UIViewController to house each image). I'd recommend the first option. The process would go something like:
Add the UIScrollView as a subview of your main view (remember, ensure to set pagingEnabled to YES
Add each image to the scroll view
Set the scroll view's content size to the total width of all images
Thanks for the clarification!
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