how to make disable the default leftbarbutton in navigation bar in Iphone sdk?
I want to disable the left bar button when my webview is loading can a开发者_开发百科ny one tell how to disable the leftbarbutton?
Anyone'shelp will be much appreciated. Thank you, Monish.
I put a blank image at the leftBarButtonItem to hide the back button on the first page.
UIButton *btn=[UIButton buttonWithType:UIButtonTypeCustom];UIImage *btnImage = [UIImage imageNamed:@""]; [btn setImage:btnImage forState:UIControlStateNormal];
[btn setBackgroundColor:[UIColor clearColor]];
btn.frame=CGRectMake(0, 0,btnImage.size.width, btnImage.size.height);
self.navigationItem.leftBarButtonItem=[[[UIBarButtonItem alloc]initWithCustomView:btn] autorelease];
This one line Code enough
self.navigationItem.hidesBackButton = YES;
Set the enabled
property of the leftBarButtonItem to NO.
精彩评论