How to set tab bar item title programmatically in objective c?

前端 未结 10 1371
猫巷女王i
猫巷女王i 2021-01-31 15:46

I want to set title to tab item programatically, but it not works. My code is below:

- (IBAction)tab1Click:(id)sender {
    myTabBarController = [[UITabBarContro         


        
10条回答
  •  说谎
    说谎 (楼主)
    2021-01-31 16:24

    If you are calling this from within an embedded UIViewController, you can change the parent tab bar title with:

    self.tabBarController.title = @"My Title.";

提交回复
热议问题