开发者

how to make disable the default leftbarbutton in navigation bar in Iphone sdk?

开发者 https://www.devze.com 2022-12-25 02:17 出处:网络
I want to disable the left bar button when my webview is loading can a开发者_开发百科ny one tell how to disable the leftbarbutton?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消