tabBarController unLoad itself after call modalView

后端 未结 3 1319
臣服心动
臣服心动 2021-01-29 02:08

I have tabBarController with 6 views. As default tabBarController load first view, I need to load view #6 at my application start, so in my tabBarController I add to viewW

3条回答
  •  旧巷少年郎
    2021-01-29 02:45

    Do something like this in the viewDidAppear method of your tab bar controller, so it only sets the selectedIndex when the app starts up:

    -(void)viewDidAppear:(BOOL)animated {
        [super viewDidAppear:animated];
        static BOOL isFirst = YES;
        if (isFirst) {
            [self setSelectedIndex:6];
            isFirst = NO;
        }
    }
    

提交回复
热议问题