1 のストーリーボードがあり、ネストされた多数の s を含むUIViewController
1 を保持しています。View Controller をサブクラス化して、このメソッドを実装しました。UIView
UIView
- (BOOL)shouldAutorotateToInterfaceOrientation: UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight || interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
私も追加しました
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIInterfaceOrientation</key>
<string>UIInterfaceOrientationLandscapeLeft</string>
にInfo.plist
。
メイン UIView の viewDidLoad で、私はこれをやっています:
PASectionView* sectionView = [[PASectionView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, 180)];
[self addSubview:sectionView];
問題は、コントロールの幅が予想される 1024 ピクセルではなく 756 ピクセルしかないことです。詳細については、以下のスクリーンショットを参照してください。私はウェブ全体を検索してきましたが、このイライラする問題の解決策がどこにも見つかりません。基本SDKとして設定されたiOS5.1でXcode 4.5を使用しています。
編集 フレームを境界に置き換えることで機能しています。ただし、何が起こっているのか理解できないため、フレームサイズでは機能しません。