Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在做一个自定义键盘,但我不知道如何在 uitextfield 中显示它。我怎样才能做到这一点 ?(我使用 UIView 作为我的键盘并在文件 nib 中进行设计。)
你需要写这个;-
*yourtextfieldname*.inputView=*yourcustomkeyboardviewname*;
来自 Apple Docs:-
输入视图
当文本字段成为第一响应者时显示的自定义输入视图。
@property(读写,保留) UIView *inputView
讨论 如果此属性中的值为 nil,则文本字段在成为第一响应者时显示标准系统键盘。将自定义视图分配给此属性会导致显示该视图。
此属性的默认值为 nil。
http://developer.apple.com/library/ios/#documentation/uikit/reference/UITextField_Class/Reference/UITextField.html