iPhone - 可能不显示键盘但仍然在UITextField中显示光标? [英] iPhone - possible to not show keyboard but still show the cursor in a UITextField?

查看:331
本文介绍了iPhone - 可能不显示键盘但仍然在UITextField中显示光标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在用户点击UITextField时显示自定义键盘。但同时我想在文本字段中显示光标。如果ifBecomeFirstResponder返回NO,则它不显示默认键盘,但也不显示光标。

I have a custom keyboard I want to show when the user taps a UITextField. But at the same time I want to show the cursor in the textfield. If if return a NO for canBecomeFirstResponder, it doesn't show the default keyboard but doesn't show the cursor either.

有人可以帮帮我吗?

谢谢。

推荐答案

您的问题的答案是创建一个视图您的自定义键盘,然后编辑 inputView 属性UITextField_Class / Reference / UITextField.htmlrel =noreferrer> UITextField 并传递自定义键盘的视图。

The answer to your problem is to create a view for your custom keyboard and then edit the inputView property of your UITextField and pass it the view for your custom keyboard.

我希望有所帮助。

这篇关于iPhone - 可能不显示键盘但仍然在UITextField中显示光标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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