iOS隱藏狀態列

2021-07-03 06:10:37 字數 554 閱讀 4435

ios6和ios7在隱藏 status bar 三種方式比較:

storyboard

介面上選中uiviewcontroller,最右邊simulated metrics找到 status bar 設定成 none

viewcontroller

ios 7

info.plist

不但要在info.plist中增加 status bar is initially hidden一行,選擇為 yes,

//改變狀態列的前景色

- (uistatusbarstyle)preferredstatusbarstyle

//隱藏狀態列

- (bool)prefersstatusbarhidden//for ios7.0

/*** 需要改變狀態列狀態的viewcontroller 在跟根檢視中使用

* @return uiviewcontroller

**/- (uiviewcontroller *)childviewcontrollerforstatusbarstyle

需要重新整理時 

iOS隱藏狀態列

在targets general 勾選中hide status bar 整個專案隱藏狀態列 google一下發現現在的解決方法有兩種 如果只是單純的隱藏狀態列,那麼是在預設情況下,只需要重新實現兩個新方法 uistatusbarstyle preferredstatusbarstyle bool p...

ios 隱藏頂部狀態列

ios6和 ios7在隱藏 status bar 三種方式比較 storyboard 介面上選中uiviewcontroller,最右邊simulated metrics找到 status bar 設定成 none 實現prefersstatusbarhidden方法,返回 yes bool pre...

IOS狀態列隱藏設定

一.用 設定狀態列的顯示和隱藏 bool perfersstatusbarhidden 同樣的方法設定狀態列的樣式 複寫的方法為 uistatusbarstyle preferredstatusbarstyle 二.用 plist 設定狀態列的顯示和隱藏 在 plist 中新增status bar ...