IOS “64边距”--translucent属性

来源:互联网 发布:在windows上编写swift 编辑:程序博客网 时间:2024/06/03 11:35

translucent 默认为Yes,(0,0)点在最上面

[[UINavigationBarappearance]setTranslucent:YES];


 translucent 默认为NO,(0,0)点在Navigation下面

[[UINavigationBarappearance]setTranslucent:NO];


automaticallyAdjustsScrollViewInsets = YES时系统底层所干的事
scrollView的内容原本没有内边距,但是考虑到导航栏(高度44px)、状态栏(高度20px)、TabBar(高度49px)会挡住后面scrollView所展示的内容,系统自动为scrollView增加上下的内边距


[[UINavigationBarappearance] setBackgroundImage:[UIImagenew] forBarMetrics:UIBarMetricsDefault];

setBackgroundImage的优先级比barTintColor高;你设置了BackgroundImage 在设置barTintColor就灭有作用了

[[UINavigationBar appearance] setShadowImage:[UIImage new]];

可以去掉navigation下面的那一条线



参考链接 http://www.jianshu.com/p/930643270455


临渊羡鱼不如退而结网


0 0
原创粉丝点击