ios - 我可以更改键盘方向吗?

标签 ios xcode keyboard orientation

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

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

我的按钮、标签、文本字段和其他对象可以根据设备的当前方向旋转。但键盘不想旋转=/ 我如何旋转键盘或者不能旋转键盘。谁知道? 请帮忙) http://www.pictureshack.ru/images/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;
}

关于ios - 我可以更改键盘方向吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19810036/

相关文章:

objective-c - 奇怪的dispatch_async内存行为

ios - 我们可以[ self 释放]吗?

java - 将文本绘制到像素图上 (LibGDX)

iOS 9.2 : Select List (multiple) incorrectly firing change event and setting value to first option on focus.(Safari 和 Chrome)

iphone - iOS 6 应用商店 : URL to search for apps corresponding to defined keywords on Appstore?

ios - 如何计算ios中的年龄?

ios - 如何将预制 IBAction 连接到我的 Storyboard?

c - 键盘输入,不同的按键有不同的响应

ios - 在不调用 didSelectRowAtIndexPath 的情况下关闭键盘

objective-c - NSWindow 不接收键盘事件