我可以更改键盘方向吗?

例如,我使用此代码关闭自动旋转

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

我的按钮,标签,textFields和其他对象可以根据设备的当前方向旋转。 但键盘不想旋转= /如何我可以旋转键盘或我不能。 谁知道? 请帮忙) http://sofzh.miximages.com/ios/8145_Snimok_ekrana_05_11_2013_18_55_00_s_Simulyatora_iOS.png

键盘方向与状态栏方向相同。

在图像中,所有按钮和文本方向都不在状态栏的方向。

尝试以下代码

 -(BOOL)shouldAutorotate { return NO; } -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientationPortrait; } 

好。 决定certificate是一个简单的。 在我检查设备方向的方法中,我添加了这个代码并且它正在工作。

  if (deviceOrientation == UIDeviceOrientationPortrait){ [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO]; } else if (deviceOrientation == UIDeviceOrientationPortraitUpsideDown){ [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortraitUpsideDown animated:NO]; } else if (deviceOrientation == UIDeviceOrientationLandscapeLeft){ [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO]; } else if (deviceOrientation == UIDeviceOrientationLandscapeRight){ [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft animated:NO]; } 

希望这对某人有帮助!)