Custom scrollbar on iOS top bar

I have a question about the possibility of creating a custom tab bar at the top of the screen of an iOS application. I am looking for a tab bar very similar to the vevo app (pictured below). I checked this scroll bar ( https://github.com/vermontlawyer/JFATabBarController ), but would like to move it to the top, and it seems to be buggy when I edit the source code ... I suppose I cannot use the standard tabbarcontroller for this, but should make its own tab bar ... right? How can I create a custom scroll tab bar at the top of the screen?

Thanks so much for any feedback!

vevo tab screen 1vevo tab screen 2

+5
source share
4 answers

this project can help you: https://github.com/Marxon13/M13InfiniteTabBar , but you need

It consists of an infinite UITabBar with a built-in UIScrollView;) and it can be configured to place a tab at the top of the screen.

enter image description here

Hope this helps!

+7
source

Basically, you would do something like the following:

@class CustomTabBar; @protocol CustomTabBarDatasource <NSObject> - (int)numberOfElementsInCustomTabBar:(CustomTabBar *)bar; - (NSString *)titleForTabAtIndex:(int)index inCustomTabBar:(CustomTabBar *)bar; @end @protocol CustomTabBarDelegate <NSObject> - (void)customTabBar:(CustomTabBar *)bar activatedTabAtIndex:(int)index; @end @interface CustomTabBar : UIView @property (weak) id<CustomTabBarDataSource> dataSource; @property (weak) id<CustomTabBarDelegate> delegate; @end @interface YourViewController : UIViewController { CustomTabBar *myTabBar; } @end @interface YourViewController (TabBarDataSource) <CustomTabBarDataSource> @end @interface YourViewController (TabBarDelegate) <CustomTabBarDelegate> @end 

The implementation for your CustomTabBar will include a UIScrollView and a set of UIButton s, the name of which you will get from the dataSource . When the button starts, you call the delegate method customTabBar:activatedTabAtIndex: Your YourViewController will change its contents when you run the delegate method.

+1
source

You can look at this library: https://github.com/raihan/ZRScrollableTabBar . It is simple and easy and can help you.

0
source

I was looking for a similar solution, but in the end I came up with my own and wanted to share with anyone who can look at it later.

https://github.com/chrismanahan/Simple-Scrolling-Tab-Bar

This is an easy way to create a sliding tab bar with the standard UITabBarController in your storyboard.

0
source

Source: https://habr.com/ru/post/1204267/


All Articles