看板 MacDev 關於我們 聯絡資訊
我目前在寫的部分暫時只有一個頁面有螢幕旋轉的需求 我參考網路上的方法 把每一個畫面都加上 -(BOOL)shouldAutorotate { return NO; } -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationPortrait; } 我發現一般的畫面都可以禁止螢幕旋轉 但是屬於tabbar controller 的子頁都還是一樣配合螢幕旋轉 有人知道怎麼解決嘛? 另外最後問一下 Tab Bar Controller的根視窗是不是沒辦法新增.h連結進去啊? 所以我上面的程式碼只有寫在home對應的檔案當中 (子頁 tab bar item) root tabbarcontroll => home => list => ..... 感謝 ~~~ -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 219.68.248.100 ※ 文章網址: http://www.ptt.cc/bbs/MacDev/M.1402915848.A.990.html
gagalucia:stackoverflow 這篇可以參考一下 http://goo.gl/Q5cejk 06/17 00:40
zen4641:這篇我看過 ~ 不知道是不是因為我用STORYBOARD 所以沒用 06/17 07:56
blueways:你的情況你必須要自行繼承UITabBarController 06/17 08:45
blueways:然後再覆寫你上面列的那些方法才能控制 06/17 08:46
gagalucia:如果你的tabBarController.viewControllers放的是 06/17 09:54
gagalucia:UINavigationController,要依照相同的原理加入category 06/17 09:55
gagalucia:才會根據最後的viewController裡的orientation 06/17 09:55
gagalucia:類似是appDelegate->UITabBarController->UINavigation 06/17 09:56
gagalucia:→UINavigationConroller→UIViewController 06/17 09:56
gagalucia:簡寫一下 AppDelegate→tab→navigation→view 這樣 06/17 09:58
gagalucia:至於用category或subclass實作就看個人 06/17 09:58