6

私はすでにランドスケープ モード用のアプリを開発しましたが、現在、クライアントはランドスケープ モードとポートレート モードの両方でビルドするよう求めています。

横向きビューを縦向きビューに変換するにはどうすればよいですか?

今、ランドスケープビューにこのコードを使用しています:

 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{

 return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight);

 }

私を助けてください....

よろしくお願いします:)

4

3 に答える 3

1

シンプルで、すべての向きをサポートするには、に戻るだけYESですshouldAutorotateToInterfaceOrientation

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{
    return YES;
    //Or to support all but portrait upside down
    return interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;
}
于 2012-09-05T13:55:25.277 に答える
0

自動サイズ変更マスクの使用方法を学びます。それらは単純ですが、ほとんどの場合非常に強力です。

于 2012-09-05T13:06:49.080 に答える
0

NSPostWhenIdle は正しいです。yes shouldAutorotateToInterfaceOrientation を返すだけです。そうすれば、すべての向きをサポートできます。XIB を使用してプロパティのサイズを変更する方法をご覧ください。それはまたあなたの仕事を容易にします。

于 2012-09-21T11:25:44.133 に答える