2016-02-29 69 views
0

我在狀態欄的頂部添加了一個子視圖。首先,我創建一個新的窗口:添加UIWindow刪除狀態欄

let currentWindow = UIApplication.sharedApplication().keyWindow 

currentWindow?.windowLevel = UIWindowLevelStatusBar 

接下來,我添加子視圖:

currentWindow?.addSubview(self.profileView!) 

我遇到的問題是,當我刪除子視圖,狀態欄不顯示任何更多的應用程序。我是否應該刪除currentWindow

+0

顯示更多的代碼,比如你在哪裏創建第二個窗口,以及如何刪除第二個窗口。也許是你想要的樣子的截圖。 –

回答

1

當您刪除您的子視圖時,您需要將windowLevel設置回其默認值,以便狀態欄再次可見。

let currentWindow = UIApplication.sharedApplication().keyWindow 
currentWindow!.windowLevel = UIWindowLevelNormal 
+0

工作過,謝謝! – cb428