首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何在objective c中以编程方式设置选项卡栏项目标题?

如何在objective c中以编程方式设置选项卡栏项目标题?
EN

Stack Overflow用户
提问于 2012-01-19 20:22:25
回答 10查看 66.3K关注 0票数 37

我想设置标题选项卡项编程,但它不起作用。我的代码如下:

代码语言:javascript
运行
复制
- (IBAction)tab1Click:(id)sender {
    myTabBarController = [[UITabBarController alloc] init];        
    view2Controller = [[View2Controller alloc] init]; 
    [view2Controller setTitle:@"title"];
    view3Controller = [[View3Controller alloc] init];  
    deneme = [[ViewController alloc] init];  

    myTabBarController.viewControllers = [NSArray arrayWithObjects:deneme, view2Controller,view3Controller, nil]; 
    [self.view addSubview:myTabBarController.view];    
    myTabBarController.selectedIndex=1;
}
EN

Stack Overflow用户

发布于 2012-09-26 23:16:28

如何在实际的View Controller (而不是App Delegate)中执行此操作:

代码语言:javascript
运行
复制
// set tab title
self.title = @"Tab Title";
// optionally, set different title for navigation controller
self.navigationItem.title = @"Nav Title";
// Note: self.title will reset Nav Title. Use it first if you want different titles
票数 29
EN
查看全部 10 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8925950

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档