美文网首页
自定义TabBarController,支持双击回到顶部

自定义TabBarController,支持双击回到顶部

作者: 豫风 | 来源:发表于2017-07-01 14:55 被阅读70次

效果图:

TabBar.gif

说明:
这个一个使用非常简单的自定义TabBarController,支持双击回到顶部事件。
只需要子控制遵守协议DoubleClickProtocol,实现协议方法即可回调双击事件。
改变字体配置信息在HHCommonInitial.h

使用方法:

    HHTest0ViewController *vc1 = [HHTest0ViewController new];
    HHTest1ViewController *vc2 = [HHTest1ViewController new];
    HHTest2ViewController *vc3 = [HHTest2ViewController new];
    HHTest3ViewController *vc4 = [HHTest3ViewController new];
    
    self.viewControllers = @[vc1,vc2,vc3,vc4];
    
    [self.tableBarView configTableBarTitle:@"主页" normalImage:@"icon_tab_my_nor" selectedImage:@"icon_tab_my_pressed" atIndex:0];
    [self.tableBarView configTableBarTitle:@"好友" normalImage:@"icon_tab_my_nor" selectedImage:@"icon_tab_my_pressed" atIndex:1];
    [self.tableBarView configTableBarTitle:@"发现" normalImage:@"icon_tab_my_nor" selectedImage:@"icon_tab_my_pressed" atIndex:2];
    [self.tableBarView configTableBarTitle:@"个人" normalImage:@"icon_tab_my_nor" selectedImage:@"icon_tab_my_pressed" atIndex:3];

下载地址:Github

相关文章

网友评论

      本文标题:自定义TabBarController,支持双击回到顶部

      本文链接:https://www.haomeiwen.com/subject/ohzwcxtx.html