0
我正在使用SWRevealViewController,它工作正常。但UIBarButtonItem圖像在第二個視圖控制器之後不可見。對於第一個它工作正常。我使用tableviewcells中的storyboard segue。在secondviewcontroller中UIBarbuttonItem對於swrevealviewcontroller不可見?
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if([segue isKindOfClass:[SWRevealViewControllerSegueSetController class] ]){
UIViewController *dvc = [segue destinationViewController];
UINavigationController *navCtrl = (UINavigationController *) self.revealViewController.frontViewController;
[navCtrl setViewControllers:@[dvc] animated:NO];
[self.revealViewController setFrontViewPosition:FrontViewPositionLeft animated:YES];
}
}
我在SideMenuViewController
類中使用上面的代碼。
我只使用以下代碼在FrontViewController
viewDidLoad
。
UILabel* lbNavTitle = [[UILabel alloc] initWithFrame:CGRectMake(0,40,320,40)];
lbNavTitle.textAlignment = NSTextAlignmentLeft;
lbNavTitle.text = NSLocalizedString(@"Hello World!",@"");
self.navigationItem.titleView = lbNavTitle;
self.barButton.target = self.revealViewController;
self.barButton.action = @selector(revealToggle:);
[self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];