iPhone - Toolbar in UIViewController disappear right after showing up
I use this code to display a one item Toolbar in UIViewController (which is pushed by UINavigationController). The toolbar shows up and immediately disappear:
UIBarButtonItem * logoutButton = [[UIBarButtonItem alloc] initWithTitle:@"Log out" style:UIBarButtonItemStylePlain target:self action:nil];
NSMutableArray * arr = [NSMutableArray arrayWithObjects:logoutButton, nil];
[self setToolba开发者_JAVA百科rItems:arr animated:NO];
[self.navigationController setToolbarHidden:NO animated:NO];
Do you know what the problem is?
where is this code? Doesn't seem to be anything out of the ordinary here so either has to do with where you are calling it, or something else that happens afterwards (like setting toolbarHidden to YES later or something)
精彩评论