1
我用下面的代碼來導航欄上顯示的UIImage導航欄返回按鈕消失
-(void)hideTopBanner:(bool)b;
{
if(b)
{
[UIView animateWithDuration:0.35 animations:^{
UIView *bannerView =[self.navigationController.navigationBar viewWithTag:999];
[bannerView setFrame:CGRectMake(-320, 8, 144, 30)];
}];
}
else {
[UIView animateWithDuration:0.35 animations:^{
UIView *bannerView =[self.navigationController.navigationBar viewWithTag:999];
[bannerView setFrame:CGRectMake(88 , 8, 144, 30)];
}];
}
}
// --------------
UIImageView *bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"topbg1.png"]] ;
[bgImageView setFrame:CGRectMake(0, 0, 320, 46)];
[self.navigationController.navigationBar addSubview:bgImageView];
bgImageView.tag=999;
[bgImageView release];
我嘗試使用
UIBarButtonItem *myBarButtonItem = [[UIBarButtonItem alloc] init];
myBarButtonItem.title = @back"; // or whatever text you want
self.navigationItem.backBarButtonItem = myBarButtonItem;
[myBarButtonItem release];
顯示後退按鈕,但沒有顯示
但是當它導航到另一個視圖控制器。 導航欄上的後退按鈕消失。
歡迎任何評論
你有沒有嘗試設置任何所有權的ViewController? –