iOS8 中的自定义设计 TabBar

Custom design TabBar in iOS8

我想制作一个自定义设计的标签栏,如下图所示。

正确的做法是什么?我开始为此构建自己的解决方案,但也许从 UITabBarController 继承会更好。 这样我只找到了改变图标颜色或位置的解决方案,但我需要更多。

有什么想法吗? 谢谢

我有类似的问题。我使用了一个 UIVew ,在里面我画了几个 UIButtons 对应于我的选项卡。下面我有 UITableView。当我单击一个按钮时,我重新加载了 UITableView

这是非常简单的解决方案。

替代解决方案是为此使用无数库之一,例如:

https://github.com/iltercengiz/ICViewPager

您可以使用 UIView 和 UIButton 控件创建自定义选项卡 control.you 可以从 here

中获得灵感

我找到了解决办法。 我使用标准 UITabBarController,但带有隐藏的 tabBar,然后在顶部添加了一些自定义外观按钮。

隐藏标签栏: 输入 viewDidLoad

[self.tabBarController.tabBar setTranslucent:YES];
[self.tabBarController.tabBar setHidden:YES];

带有编程选项卡开关的自定义按钮

- (IBAction)secoundView:(id)sender {
    [self.tabBarController setSelectedIndex:1];
}
- (IBAction)firstView:(id)sender {
    [self.tabBarController setSelectedIndex:0];
}