有谁知道如何在导航视图前面显示容器视图控制器?然后根据通知删除它?
下面是我如何在当前视图中显示它,但我希望它覆盖整个屏幕,包括导航视图。我想我可以创建一个使用以下代码的自定义uinavigation控制器?
-(void)showRate {
if(nil == self.rateView) {
self.rateView = [self.storyboard instantiateViewControllerWithIdentifier:@"Rate"];
}
// Show the container view
self.rateView.view.frame = CGRectMake(0, -600, 320, self.view.frame.size.height);
self.rateView.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[self.view addSubview:self.rateView.view];
[self addChildViewController:self.rateView];
[self.rateView didMoveToParentViewController:self];
[UIView animateWithDuration:0.5 delay:0.1 options:(UIViewAnimationCurveEaseOut) animations:^{
//Slide the waitview on screen
self.rateView.view.frame = CGRectMake(0, 0, 320, self.view.frame.size.height);
} completion:^(BOOL finished) {
//do nothing at end
}];
}
答案 0 :(得分:0)
如果要覆盖整个屏幕(包括导航栏和状态栏),请在主窗口上添加视图,如果您只想覆盖视图,则可以将自定义视图添加为子视图。
答案 1 :(得分:0)
要将任何子视图添加到最顶部,甚至在导航栏上,请使用此
[[UIApplication sharedApplication].keyWindow addSubview:yourSubView];
希望这有帮助!