1. 程式人生 > >iOS navigationBar與tabBar的translucent

iOS navigationBar與tabBar的translucent

navigationBar

translucent = YES (預設值) 時,UIViewControllerself.view 的原點是(0,0)

translucent = NO 時,UIViewControllerself.view 的原點是 (0,CGRectGetMaxY(self.navigationController.navigationBar.frame))


tabBar

translucent = YES (預設值) 時,UIViewControllerself.view 的底部會被 tabBar 遮擋

translucent = NO

時,UIViewControllerself.view 的底部不會被 tabBar 遮擋,也就是:

CGRectGetMaxY(self.view.frame) == CGRectGetMinY(self.tabBarController.tabBar.frame);

當 設定tabBarbackgroundImage,shadowImage 時,也相當於 translucent = NO


CollectionView橫向排版:

https://github.com/xjh093/JHCollectionViewFlowLayout


我 的 github:

https://github.com/xjh093