自定义UItabBar项目顺序

问题描述:

我想更改UITabBar项目的顺序。
然后当我再次登录时,应该保持顺序。自定义UItabBar项目顺序

这是怎么做到的?有谁能够帮助我?我浪费了一整天来实现这一点。

+0

你是以编程方式创建tabBar还是使用nib文件? – 2010-12-21 15:33:48

,如果你愿意以编程方式做到这一点应该是相当简单: 坚持每个视图的索引,然后每个视图添加到在同一顺序的数组做负载:

//construct your view controllers somehow and add them to an array in the order you want them to be: 
    [myArr addObject:viewCon1]; 
    [myArr addObject:viewCon3]; 
    [myArr addObject:viewCon2]; 

构建你的TabBar使用你的阵列

_tabControl = [[UITabBarController alloc] init]; 
[_tabControl setViewControllers:myArr animated:YES];