项目介绍:
[分享] M13InfiniteTabBar is an elegant replacement for UITabBar.
一款可以替代UITabBar的优雅的TabBar框架
使用方法如下:
Set Up:
- First create all the view controllers and their tabs.
[Objective-C] 查看源文件 复制代码
UIViewController *vc1 = [[UIViewController alloc] init]; UIViewController *vc2 = [[UIViewController alloc] init]; UIViewController *vc3 = [[UIViewController alloc] init]; UIViewController *vc4 = [[UIViewController alloc] init]; UIViewController *vc5 = [[UIViewController alloc] init]; M13InfiteTabBarItem *item1 = [[M13InfiniteTabBarItem alloc] initWithTitle:@"Title" selectedIconMask:[UIImage imageNamed:@"image.png"] unselectedIconMask:[UIImage imageNamed:@"image.png"]]; M13InfiteTabBarItem *item2 = [[M13InfiniteTabBarItem alloc] initWithTitle:@"Title" selectedIconMask:[UIImage imageNamed:@"image.png"] unselectedIconMask:[UIImage imageNamed:@"image.png"]]; M13InfiteTabBarItem *item3 = [[M13InfiniteTabBarItem alloc] initWithTitle:@"Title" selectedIconMask:[UIImage imageNamed:@"image.png"] unselectedIconMask:[UIImage imageNamed:@"image.png"]]; M13InfiteTabBarItem *item4 = [[M13InfiniteTabBarItem alloc] initWithTitle:@"Title" selectedIconMask:[UIImage imageNamed:@"image.png"] unselectedIconMask:[UIImage imageNamed:@"image.png"]]; M13InfiteTabBarItem *item5 = [[M13InfiniteTabBarItem alloc] initWithTitle:@"Title" selectedIconMask:[UIImage imageNamed:@"image.png"] unselectedIconMask:[UIImage imageNamed:@"image.png"]]; Next create the M13InfiniteTabBarController and set its delegate
- Next create the M13InfiniteTabBarController and set its delegate
[Objective-C] 查看源文件 复制代码
M13InfiniteTabBarController *viewController = [[M13InfiniteTabBarController alloc] initWithViewControllers:@[vc1, vc2, vc3, vc4, vc5] pairedWithInfiniteTabBarItems:@[item1, item2, item3, item4, item5]];
- Customize any of the other attributes of M13InfiniteTabBar after it has been initalized.
- To be able to direct the user’s attention, set the requires user attention background view. This feature is separated to allow easy subclassing and custom designs.
[Objective-C] 查看源文件 复制代码
viewController.requiresAttentionBackgroundView = [[PulsingRequiresAttentionView alloc] init];
- Lastly display the controller by adding it to a UIWindow, or pushing it onto a UINavigationController stack.
DEMO 直接下载: