【问题标题】:UiPageController and NavigationBar页面控制器和导航栏
【发布时间】:2014-01-03 13:02:33
【问题描述】:

我的问题是没有在我的控制器中显示第一个视图的导航栏标题。 对于下一个项目,文本正在显示。 我的代码:

ViewControllerEvent *initialViewController = [self viewControllerAtIndex:self.index];
NSArray *viewControllers = [NSArray arrayWithObject:initialViewController];
[self.pageController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];

和 ViewController 代码:

- (void)viewDidAppear:(BOOL)animated{
    self.navigationController.navigationBar.topItem.title = [self.event objectForKey:@"name"];
}

【问题讨论】:

    标签: ios uinavigationcontroller uipageviewcontroller


    【解决方案1】:

    试试这个

    - (void)viewDidAppear:(BOOL)animated{
        [super viewDidAppear:animated];
        self.navigationController.title = [self.event objectForKey:@"name"];
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-11
      • 1970-01-01
      相关资源
      最近更新 更多