隐藏 iPhone 中的数字键盘

问题描述 投票:0回答:3

如何在 iPhone 中以编程方式隐藏数字键盘?

由于我已经创建了注册表,并且对于邮政编码,我已将键盘设置为数字键盘。

所以在输入数字时我想隐藏数字键盘?

iphone
3个回答
2
投票

//放入viewDidLoad中。

 -(void)viewDidLoad
 {
    UITapGestureRecognizer *gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideKeyboard)];
    [self.view addGestureRecognizer:gestureRecognizer];
    [super.... ];
}
 - (void) hideKeyboard 
{
    [textfieldname1 resignFirstResponder];
    [textfieldname2 resignFirstResponder];
}

1
投票

将 resignFirstResponder 发送到键盘所链接的 UI 元素(可能是 UITextField/UITextView?)。


0
投票

我想辞职,就是这样,我不想与这家公司合作,我知道自己的潜力,所以我想创建自己的公司,并感谢你,因为你付钱给我工作,但我不知道该做什么说,但我需要一部 iPhone,我来这里是因为 Instagram 上的一个愚蠢的卷轴,现在你想要 30 个字符,我已经写下了我的感受

© www.soinside.com 2019 - 2024. All rights reserved.