如何在 Xcode 项目中禁用当我在 TextField 中触摸时出现的键盘? [英] How can i disable in a Xcode project that a keyboard appears when i touch in a TextField?

查看:28
本文介绍了如何在 Xcode 项目中禁用当我在 TextField 中触摸时出现的键盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在创建 xcode 项目方面有点新,所以我有一个程序,我需要按 TextField 来插入一些值,但我不想使用本机键盘执行此操作,而只想使用我的按钮会创建,就像计算器一样.

Im a bit new in creating a xcode projects, so i have a program that i need to press the TextField to insert some values, but I don't want to do that with the native keyboard but only with the buttons that I will create, like a calculator.

我已经探索了一些定义,但找不到选项!

所以我想知道如何禁用这个选项到键盘出现!

So I would like to know how can disable this option to the keyboard appears!

推荐答案

在你的 viewController 中使用这个函数.

Use this function in your viewController.

- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
     return NO; //hide keyboard
}

这篇关于如何在 Xcode 项目中禁用当我在 TextField 中触摸时出现的键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆