简体   繁体   中英

Navigationbar Translucent property

FirstViewController导航栏

介于两者之间

SecondViewController导航栏是半透明的

I am having a requirement where my first view controller has

self.navigationController.navigationBar.translucent = YES;

and second view controller has

self.navigationController.navigationBar.translucent = NO;

so while navigating from first view controller to second view controller i can see a white space on top... can anyone help me for smooth navigation.

try to insert following code into your viewDidLoad:

if( [self respondsToSelector:@selector(edgesForExtendedLayout)] ) {
self.edgesForExtendedLayout = UIRectEdgeNone;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM