2

たとえば、このコードで自動回転をオフにします

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return NO;
}
-(BOOL)shouldAutorotate
{
    return NO;
}
-(NSUInteger)supportedInterfaceOrientations
{
    return 0;
}

また、ボタン、ラベル、textFields、およびその他のオブジェクトは、デバイスの現在の向きに応じて回転できます。しかし、キーボードは回転したくない=/キーボードを回転できるかできないか。知るか?助けてください) http://www.pictureshack.ru/images/8145_Snimok_ekrana_05_11_2013_18_55_00_s_Simulyatora_iOS.png

4

2 に答える 2

1

キーボードの向きは、ステータス バーの向きと同じです。

画像では、すべてのボタンとテキストの向きがステータスバーの向きではありません。

次のコードを試してください

-(BOOL)shouldAutorotate
{
    return NO;
}

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return UIInterfaceOrientationPortrait;
}
于 2013-11-06T12:04:38.783 に答える