0

Does anyone know how to show a containerview controller in front the navigation view? And then also remove it based on a notification?

Below is how I get it to show in my current view, but I want it to cover the entire screen, including the navigation view. I am thinking I can create a custom uinavigation controller that uses the below code?

-(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
}];
}
4

2 回答 2

0

如果要覆盖整个屏幕,包括导航栏和状态栏,请在主窗口中添加视图,如果只想覆盖视图,则可以将自定义视图添加为子视图。

于 2013-07-01T02:10:19.530 回答
0

要将任何子视图添加到最顶部,甚至在导航栏上,使用这个

[[UIApplication sharedApplication].keyWindow addSubview:yourSubView];

希望这可以帮助!

于 2013-07-01T03:38:06.843 回答