Question

In my project have Two View Controller(First & Second) embed in a navigation controller and Translucent is set NO. but i have used prompt in First ViewController.

I used AutoLayout. if you know the solution with and without AutoLayout i will really happy

enter image description here

enter image description here

when i push to second viewcontroller. i got some black screen under navigation bar

enter image description here

I tried plenty of concept but any helped.

help me How to fix.

NOTE:

Don't say set Translucent is YES. I know if i set yes it works perfectly. but i need achieve with Translucent is NO

Updated 1: Images are updated.

Was it helpful?

Solution 2

i used this code. but i won't any hardcode solution. if you have know any other solution please share

[UIView animateWithDuration:0.3 animations:^{
        self.view.frame=CGRectMake(0, self.navigationController.navigationBar.frame.size.height+20, 320, 504);
}];

OTHER TIPS

I have turned off Autolayout - and found following solution

ViewController First

-(void)viewWillDisappear:(BOOL)animated
{
     self.view.backgroundColor = [UIColor whiteColor];

}

ViewController Second

 -(void)viewWillLayoutSubviews
 {
    AppDelegate *appDelegate = [[UIApplication sharedApplication]delegate];
    appDelegate.window.backgroundColor = [UIColor whiteColor];
    self.myView.frame = CGRectMake(0.0, 64.0, 320.0, 504.0);

 }

I hope this helps, for Autolayout it works fine as well

try to set your navigationView's backgroundColor.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top