How can I implement sliding between pages in iOS with titles like ViewPager with ViewPagerIndicator in Android? - ios

We have an Android app using ViewPager and ViewPagerIndicator where you can scroll the content and the title scrolls, but the next and previous title is visible as well on the current page. How can this be implemented in iOS?
Currently we have a UIScrollView where you can scroll between the pages and with a segmentcontrol on top. This works well for max 4 pages, but we need to remove the segmentcontrol and replace it with a titlestrip to make room for more pages.
Android example:
http://blog.pboos.ch/post/40575809334/android-pagertabstrip-viewpager
iOS app that has such an implementation:

I managed to solve this using two UIScrollViews. In the scrolled event of the content scrollview I moved the title scrollview with 0.5*offset of the title scrollview. That resulted in the effect i wanted.

This library does it and also provides other alternative ways to switch among child view controllers.
https://github.com/xmartlabs/XLPagerTabStrip

definitely you can achieve same effect in iOS as well.
check this sample app, think this will help you out.
click here

Related

How to implement Uber V2 UICollectionView

I am trying to implement the same style of UI as the new Uber iOS app, at least the pull-up view. I am wondering if this is a UICollectionView or a UITableView. How are the inner horizontal scrollable views implemented? I have done something like this before in iOS back in 2009, but that was UITableView inside a UITableView. Just wondering if UICollectionView is what should be used now?
Also, how do they allow you to drag the view up and then switch to a new view?
They seem to be simply animating transitions. There are similar questions here on SO addressing this for the card implementations used in Apple’s Music and Mail apps. As for the horizontal swiping, I would use a collection view nowadays but I don’t see it wrong using a tableView.
Hope this will help

How To Create Animated Onboarding on iOS

I'm creating an app that will have a quick onboarding at the beginning with some pretty simple scroll through animations and finish with a button to basically "GO" into the app's content.
I'm looking for suggestions as for how to most effectively and efficiently develop this, here's some things that it needs:
there should be paging so that it locks onto about 4 different positions throughout the onboarding.
the animations progress should be dependent on the scroll view's position (I'm guessing the x value of the content offset)
there needs to be views that stay on screen through multiple pages and some that move on screen and off screen throughout the onboard, it can not just be one picture moving on then off
there needs to be a button that pops up on the last page
I have a good understanding of Scroll Views, Page Views, and Page Controls. I also just bought Core Animator (the app) if anyone can suggest how implement that.
The way that I'm thinking of doing it is basically creating a Scroll View with paging that is empty and just use it to control animations with its content offset. Is there a faster way to do this or maybe a open source library that would work better? I'm only proficient in Swift currently :?
Thanks for any suggestions! This my first app and I'm very excited to hear your suggestions
I would look at UIPageViewController as its setup to do the scrolling by page for you, although you have control over what kind of animation it uses. You are responsible for feeding it view controllers to display using this method:
setViewControllers(_:direction:animated:completion:)
here is the link to the apple documentation UIPageViewController docs
I created a scrolling credits screen for one of my company's apps, FaceDancer, that would be a decent starting point for what you are after. The app is free. You can download it to check it out at this link: FaceDancer. The credits screen is off the info button on the main screen.
It's not hard to use UIView animations to simply animate a series of views. I think that might be easier than working with a scroll view.
I can give you some guidance if you think it would be helpful.

UIScrollview with section animation like UITableView

I am currently working with an app that would generate a report from the user. These reports would be displayed on a scroll view. I would like the scrollview to look like the photo feed of Instagram (please see Instagram app on iOS). This would be doable using UITableView since the section sticks up above while scrolling the row. I want to achieve the same effect using only UIScrollView. Is this doable? Please let me know your advice.
UIScrollView+TPKeyboardAvoidingAdditions
TPKeyboardAvoidingScrollView
TPKeyboardAvoidingScrollView
UIScrollView+TPKeyboardAvoidingAdditions
Download these custom classes from Github and follow the procedure given there !

Pager Sliding TabStrip in ios

I would like to use Pager Sliding TabStrip in my project.Pager Sliding Tapstrip is there for android. Can we define like this? I have taken one scroll view, added subviews on it for tables and take one uivew, added buttons as subviews and added uilabel as subview for tabstrip . While using the scrollview means dragging the scrollview, the tabsrip has to be moved.I have been stuck to this concept and i am not getting any idea to solve this issue. How do i get this concept? Please give any idea to me anyone.
Can't you use UIPageControl for this ?
From Apple example:
https://developer.apple.com/library/ios/samplecode/PageControl/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007795
And to have a custom UIPageControl, like this https://github.com/Spaceman-Labs/SMPageControl .
You can try UIPageViewController to manage your tabs.
I'm not sure how many tabs do you have. If you have many tabs and you add all tables into the scrollView at the beginning time, the performance and memory usage would be really bad.
So you'd better reuse controller and views for your tabs. If you use UIScrollView and manage them by yourself, what you can do is calculate current page according to the contentOffset, and load the current page, previous page and next page. Because three pages is enough to cover what user will see. However the better solution is using UIPageViewController, it will deal with contentOffset and pagination, what your need to do is just provide previous controller and next controller according to current controller. Then update your tab view according to current controller.
EDIT:
BTW, if by "the tabstrip has to be moved" you mean when you drag the scrollView, your tabstrip moves as well, that's because you added your tabstrip to the scrollView. What you need to do is add it to the root view, and the scrollView and the tabstrip should be siblings rather than parent and child.
I am developing application which required same features as asked by you.
I am using SHViewPageController. You can find it from following link.
https://www.cocoacontrols.com/controls/shviewpagerexample
I hope it will help you. Thanks.
This may help you....
you can change the tab at top or bottom. also it has got some nice customizations
https://github.com/iltercengiz/ICViewPager

iOS: How to get swipe effect between views of tabbed view controller?

I keep seeing apps that appear to be tabbed view controller apps, where the user can easily swipe left or right between views.
How do I enable that kind of behavior?
Thanks.
The best and least hassle free solution I found is Andrey Tarantsov's ATPagingViev class. Works just like a UITableView, i.e. how many pages do you want, scroll horiz or vert. provide view for page, etc. Very easy and well coded. It's here: SoloComponents
It also has a recycling feature so it's memory stable.
If you refer to something like Apples photo app, it is using UIScrollView which has a property to enable paging.
If you define the views content width wider than your view's frame, you'll get the effect you describe. The view will page in steps of it's bounds width.
On each page you can place another view.
http://developer.apple.com/library/ios/DOCUMENTATION/UIKit/Reference/UIScrollView_Class/Reference/UIScrollView.html
Another option I found is SwipeView:
https://github.com/nicklockwood/SwipeView

Resources