开发者

Customizing UItabBar Item order

开发者 https://www.devze.com 2023-01-31 10:35 出处:网络
I want to change the order of UITabBar items. Then when I log in again, the order should be mainta开发者_如何学Cined.

I want to change the order of UITabBar items.

Then when I log in again, the order should be mainta开发者_如何学Cined.

How this can be done? Can anybody help me? I've wasted a whole day to implement this.


if you are willing to do it programmatically it should be fairly simple: Persist the index of each view and then add each view to an array in the same order doing load:

  //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];

construct your tabbar using your array

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

精彩评论

暂无评论...
验证码 换一张
取 消