i dont know, why the button are disappear after the toolbar set to hide and unhide. how can i fix it?
setup a button code
-(void)viewDidAppear:(BOOL)animated {
//NSLog(@"viewDidAppear ");
[self becomeFirstResponder];
//Create a button
UIBarButtonItem *back = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemRewind
target:self action:@selector(goback:)];
UIBarButtonItem *fixspace1 = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:self action:nil];
UIBarButtonItem *next = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFastForward
target:self action:@selector(gofwd:)];
UIBarButtonItem *stop = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemStop
target:self action:@selector(stopload:)];
UIBarButtonItem *refresh = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh
target:self action:@selector(refreshWeb:)];
[self.navigationController.toolbar setItems:[NSArray arrayWithObjects:fixspace1, back, fixspace1, stop, fixspace1, next, fixspace1, nil] animated:YES];
[self.navigationItem setRightBarButtonItem:refresh animated:YES];
[self.navigationController.view addSubview:self.navigationController.toolbar];
[stop release];
[next release];
[back release];
[refresh release];
[fixspace1 release];
}
and i setup my button at this method
-(void)viewDidAppear:(BOOL)animated
this code use for hide toolbar
[self.navigationController setNavigationBarHidden:YES animated:YES];
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];
[self.navigationController setToolbarHidden:YES animated:YES];