視圖控制器的各種frame獲取

在這裏插入圖片描述

獲取全屏視圖的位置大小,高包含狀態欄和導航欄高

UIScreen.mainScreen.bounds{0,0,320,568}

獲取全屏視圖的位置大小(@2x)

UIScreen.mainScreen.nativeBounds{0,0,640,1136}

獲取全屏視圖的位置大小,高不包含狀態欄

UIScreen.mainScreen.applicationFrame{0,20,320,548}

獲取UINavigationController視圖的位置大小

self.navigationController.navigationBar.frame{0,20,320,44}

獲取self.view視圖的位置大小

self.view.frame{0,0,320,568}

獲取狀態欄視圖的位置大小

UIApplication.sharedApplication.statusBarFrame{0,0,320,20}

獲取UITabBarController視圖的位置大小

xxTabController.tabBar.frame{0,519,320,49}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章