0

我的應用程序不支持肖像模式,但有時它變成肖像模式。我正在使用Xcode 5.02 &我在iOS7上運行我的應用程序。我在設置中取消選中肖像模式,以便它不支持肖像,但是在某個時間點它變成肖像,我沒有任何線索,任何人都可以幫助我,我的應用程序是主 - 細節基礎。在應用程序委託& dashboardNavController這下面的代碼片段是UINavigationController的我的應用程序不支持肖像模式,但有時它變成肖像模式

self.window.rootViewController = self.dashboardNavController; 
[self.window makeKeyAndVisible]; 

如果需要的話我很高興地提供更多的信息,在此先感謝

回答

0

在viewDidLoad中

CGAffineTransform transform = CGAffineTransformMakeRotation(-M_PI/2); 
self.view.transform = transform; 

// Repositions and resizes the view. 
// If you need NavigationBar on top then set height appropriately 
CGRect contentRect = CGRectMake(0, 0, self.view.size.height, self.view.size.width); 
self.view.bounds = contentRect; 
試試這個
相關問題