0
我一直工作了2天,無法解決。我有一個全屏按鈕,我這樣顯示在我的UIViewController中;UIWindow子視圖無法在iOS 8上工作
_tutorialButton.frame = CGRectMake(0.0f, 0.0f, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height);
UIWindow *window = [[UIApplication sharedApplication].windows objectAtIndex:0];
[[[window subviews] objectAtIndex:0] addSubview:_tutorialButton];
此代碼正如我在iOS 7和更早版本操作系統上所預期的那樣工作。但它不適用於iOS 8.我不想使用
_tutorialButton.layer.zPosition = MAXFLOAT;
因爲這對我來說太髒了。此外,如果我使用這種方法,我需要隱藏我的UITabBar和UINavigationBar。這是iOS 8的錯誤還是我做錯了什麼?
您是否嘗試過Xcode 6中新的「調試視圖層次結構」功能? – 2014-09-25 12:28:55
是的,我試過了,不能在層次結構中看到我的按鈕。 – 2014-09-26 10:45:23