一个易于使用,轻量级的可滚动标签栏控制器,标签栏项的对文本大小非常灵活。
示例截图
在 Cocoa Pods 中可用
pod 'ZRTabView', '~> 0.1.0'
用法示例
- (void) initializeTabView
{
TestViewController *test1 = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"testViewController"];
TestViewController *test2 = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"testViewController"];
[test2.view setBackgroundColor:[UIColor lightGrayColor]];
TestViewController *test3 = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"testViewController"];
[test3.view setBackgroundColor:[UIColor orangeColor]];
ZRTabView *tabView = [[ZRTabView alloc] initWithPoint:CGPointMake(0, 0) withViews:[NSMutableArray arrayWithObjects:test1, test2, test3, nil] viewsNameArray:[NSMutableArray arrayWithObjects:@"ANYTHING", @"ANYTHING MORE", @"ANY WISH YOU WANT TO WRITE", nil] initialSelection:0];
tabView.delegate = self;
[self.view addSubview:tabView];
}
您将在代理方法中获取所选索引
-(void)didSelectTabBarWidgetIndex:(int)index
{
...
}
(MIT 许可)
版权所有 (c) 2015 Abdullah Md. Zubair [email protected]
任何人自由地获取本软件及其相关文档文件(统称为“软件”)的副本,允许在任何情况下不受限制地处理该软件,包括但不限于使用、复制、修改、合并、发布、分发、再授权及/或销售软件复制品,并允许向提供给软件的个人提供上述行为,前提是遵守以下条件
在上面的版权声明和本许可声明应包含在软件的所有副本或主要部分中。
软件按“现状”提供,不提供任何明示或暗示的保证,包括但不限于适销性、特定用途适用性和非侵权性。在任何情况下,作者或版权所有者均不对任何索赔、损害或其他责任承担责任,无论该责任是因侵权行为、合同、侵权行为或其他何种方式产生的,与软件或使用或处理软件有关。