translucent 属性


  1. <pre name="code" class="objc">//适配ios7  
  2. if( ([[[UIDevice currentDevice] systemVersion] doubleValue]>=7.0)) {  
  3. //        self.edgesForExtendedLayout=UIRectEdgeNone;  
  4.     self.navigationController.navigationBar.translucent = NO;  
  5. }  

当translucent设置为NO时,效果是这样的:

[objc] view plain copy
 
 在CODE上查看代码片派生到我的代码片
  1. self.navigationController.navigationBar.translucent = YES;  

当translucent设置为YES时,导航栏呈现半透明效果,是这样的:


 
 
原文地址:https://www.cnblogs.com/Jenaral/p/5532255.html