2011-04-20 74 views
0

我正在開發一個項目,在該項目中我想在​​啓動時旋轉iPad。我已經爲它編碼了,但它仍然無法工作。代碼我已經在.m文件須寫上在啓動時旋轉模擬器

-(void)viewWillAppear:(BOOL)animated 
{ 

[[UIDevice currentDevice]setOrientation:UIInterfaceOrientationLandscapeRight]; 
} 


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    return (interfaceOrientation = UIInterfaceOrientationLandscapeRight); 
} 

回答

2

添加「初始界面導向」到您的信息的plist並將其值設置爲「橫向(右主頁按鈕)「。我認爲這種類型是字符串。

0

將初始界面方向添加到巡迴info.plist並將其值設置爲橫向(右側主頁按鈕)