ios 开发UI布局知识点总结(一)

2019-05-21  本文已影响0人  iOS开发小学生

1.iOS 有导航栏的时候,坐标从(0,64)变成从(0,0)开始

OC的写法
self.edgesForExtendedLayout=UIRectEdgeBottom;
swift的写法
self.edgesForExtendedLayout = UIRectEdge.bottom

2.iOS 去掉导航栏和 TabBar 的黑线的方法(包括 OC 和 Swift )

OC写法
//去掉tabbar 的黑线
[self.tabBarController.tabBar setBackgroundImage:[UIImage new]];
[self.tabBarController.tabBar setShadowImage:[UIImage new]];

//去掉Navbar 的黑线
self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
[self.navigationController.navigationBar setShadowImage:[UIImage new]];

Swift写法
 //去掉tabbar 的黑线
        tabbar.backgroundImage = UIImage.init()
        tabbar.shadowImage = UIImage.init()
//去掉Navbar 的黑线
        navigationBar.shadowImage = UIImage.init()
上一篇 下一篇

猜你喜欢

热点阅读