我試圖讓一個應用程序在橫向模式下工作,我幾乎完成了,但由於某種原因,我的視圖上的按鈕不工作(即他們不按)。我使用的加載初始視圖控制器如下根視圖控制器:UIViewController風景模式按鈕不起作用
- (void)viewDidLoad
{
[super viewDidLoad];
StartViewController *viewController = [[StartViewController alloc] initWithNibName:@"StartView" bundle:nil];
self.startViewController = viewController;
startViewController.delegate = self;
[viewController release];
[self.view addSubview:startViewController.view];
}
我還設置我的Info.plist文件初始界面定位值,覆蓋在我的根視圖控制器以下內容:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return((interfaceOrientation == UIInterfaceOrientationLandscapeRight) ||
(interfaceOrientation == UIInterfaceOrientationLandscapeLeft));
//return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
視圖加載罰款,並填補了橫向模式屏幕,因爲它應該,但由於某些原因,我只是不能按任何視圖上的按鈕。
我敢肯定,這與我使用根視圖控制器相關的東西很簡單,因爲我設法使用一個視圖控制器就可以很好地工作。
有人可以幫我嗎?
你有沒有定義一個按鈕點擊的方法? – heymrcarter 2011-01-27 19:43:52