I have a subclass of QLPreviewController that I'm pushing into a UINavigationController. I am able to show/hide the bottom toolbar using:
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.navigationController.toolbarHidden = NO;
}
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
self.navigationController.toolbarHidden = YES;
}
But items I'm adding to the toolbar aren't showing up:
- (void)viewDidLoad
{
[super viewDidLoad];
UIBarButtonItem *testButtonItem = [[U开发者_StackOverflow社区IBarButtonItem alloc] initWithTitle:@"Test"
style:UIBarButtonItemStylePlain
target:self
action:@selector(testButtonClicked:)];
NSArray *myToolbarItems = [NSArray arrayWithObjects:testButtonItem, nil];
self.toolbarItems = myToolbarItems;
[testButtonItem release];
}
Any advice would be very appreciated. Thanks.
Where are you allocating and initializing that view that is giving you the problem?
Are you using a splitViewController
on iPad?
From the sound of it an object is sticking around for longer than necessary or when being called back it is not being re allocated and initialized properly before attempting to put it back on the stack, if you are using a splitViewController on iPad it handles it's views differently than a simple UINavigationController on an iPhone.
精彩评论