首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Iphone >

UINavigationController的title有关问题

2012-12-19 
UINavigationController的title问题UINavigationController + UITabBarController 这两者一起用的。。为什么

UINavigationController的title问题
UINavigationController + UITabBarController 这两者一起用的。。
为什么导航的title偏偏设置不上呢。。。
[最优解释]

引用:
引用:
你的UINavigationController + UITabBarController 是怎么用的

就是把tabbar添加到了nav的根试图上,然后把nav添加到了window中。。
self.tabBar = [[UITabBarController alloc]init];
    self.tabBar.viewControllers……


我写了个例子传了上去,你看看是不是你要的
http://download.csdn.net/detail/beijinuo/4734208
[其他解释]
你试下self.tabBar.title = @"***",另外,我觉得你这个结构设计的有点问题,最好是把导航视图控制器加入到tabbarcontroller里面,tabbarcontroller作为最顶层
[其他解释]
在每个控制器的init函数中添加
self.navigationItem.title=@"controller title";

试试这样行吗

[其他解释]

-(id) init{
   self = [super initwithNibName:nil bundel:nil];
   if(self){
      self.title = @"111";
      UITabBarItem *tbi = [self tabBarItem];
      [tbi setTitle:@"222"];
   }
   return self;
}


试试这个。
[其他解释]
你的UINavigationController + UITabBarController 是怎么用的
[其他解释]
self.title = @""; 就可以修改
[其他解释]
被push的viewcontroller的self.title就是导航栏看到的标题,不是设置导航对象的
[其他解释]
引用:
UINavigationController + UITabBarController 这两者一起用的。。
为什么导航的title偏偏设置不上呢。。。

不行啊。
[其他解释]
引用:
引用:
UINavigationController + UITabBarController 这两者一起用的。。
为什么导航的title偏偏设置不上呢。。。

不行啊。


他就会把tabbar的名称修改了。。。导航栏还是没有
[其他解释]
引用:
在每个控制器的init函数中添加
self.navigationItem.title=@"controller title";

试试这样行吗


不行啊。。
[其他解释]
引用:
Java code

-(id) init{
   self = [super initwithNibName:nil bundel:nil];
   if(self){
      self.title = @"111";
      UITabBarItem *tbi = [self tabBarItem];
      [tbi setTitle:@"222"];
   }
   ret……


导航条上面还是没有。。
[其他解释]
引用:
你的UINavigationController + UITabBarController 是怎么用的


就是把tabbar添加到了nav的根试图上,然后把nav添加到了window中。。


self.tabBar = [[UITabBarController alloc]init];
    self.tabBar.viewControllers = arry;
    
    _nav = [[UINavigationController alloc]initWithRootViewController:self.tabBar];
    [self.window addSubview:self.nav.view];

然后我想在第一个界面上面的nav上设置title
[其他解释]

引用:
你试下self.tabBar.title = @"***",另外,我觉得你这个结构设计的有点问题,最好是把导航视图控制器加入到tabbarcontroller里面,tabbarcontroller作为最顶层


我里面有四个界面,如果这样写的话 那么四个界面岂不都是同一个名字了。。。我想每个界面都有自己的名字。。。
[其他解释]
搞定了。。。谢谢各位的解答。。确实是我的结构问题。

热点排行