-1
我有創建rootview控制器呈現模態視圖控制器導航Z位置問題
- (void)viewWillAppear:(BOOL)animated
{
///set hud
[UIApplication sharedApplication].networkActivityIndicatorVisible=YES;
[[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleBlackOpaque animated:NO];
//Set Apps navbar
[email protected]"Trip Planer";
UINavigationBar *navBar= self.navigationController.navigationBar;
//[navBar setTintColor:[UIColor colorWithRed:0.102 green:0.498 blue:0.812 alpha:1] /*#1a7fcf*/];
UIImage *imagebar = [UIImage imageNamed:@"Menu-Bar"];
[navBar setBackgroundImage:imagebar forBarMetrics:UIBarMetricsDefault];
////set rightbutton menus
UIButton *rightButton = [[UIButton alloc] init];
rightButton.frame=CGRectMake(0,100.0f,23,23);
[rightButton setBackgroundImage:[UIImage imageNamed: @"Filters"] forState:UIControlStateNormal];
rightButton.highlighted=false;
[rightButton addTarget:self action:@selector(showFilters:) forControlEvents:UIControlEventTouchDown];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:rightButton];
navBar.layer.zPosition=1;
[rightButton release];
}
導航欄和我使用TSMiniwebBrowser作爲模態窗口
-(void) initTitleBar {
UIBarButtonItem *buttonDone = [[UIBarButtonItem alloc] initWithTitle:modalDismissButtonTitle style:UIBarButtonItemStyleBordered target:self action:@selector(dismissController)];
UINavigationItem *titleBar = [[UINavigationItem alloc] initWithTitle:@""];
titleBar.leftBarButtonItem = buttonDone;
CGFloat width = self.view.frame.size.width;
UIImage *navbarPortrait = [[UIImage imageNamed:@"Menu-Bar"]
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
navigationBarModal = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, width, 44)];
[[UINavigationBar appearance] setBackgroundImage:navbarPortrait
forBarMetrics:UIBarMetricsDefault];
navigationBarModal.layer.zPosition=700.0;
NSLog(@"%f",navigationBarModal.layer.zPosition);
//navigationBar.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleBottomMargin;
navigationBarModal.autoresizingMask = UIViewAutoresizingFlexibleWidth;
[navigationBarModal pushNavigationItem:titleBar animated:NO];
[self.view addSubview:navigationBarModal];
}
的主要問題是導航欄上RootViewController的始終覆蓋在 TSMiniWeb瀏覽器事件我改變zmin TSminiBrowser Navbar大於viewcontroller ..任何錯誤的mycode?