Change tab name in uitabbarcontroller

前端 未结 7 2271
离开以前
离开以前 2020-12-28 13:57

I have a TabBarController set as main controller tab, where names were defined using interface builder. Now I would like to change its names programmatically.

How c

7条回答
  •  余生分开走
    2020-12-28 14:49

    In your viewController.m

    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
    {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
      //Here you are setting title
    
    self.title = NSLocalizedString(@"Title", @"Title");
    
    }
    return self;
    }
    

提交回复
热议问题