你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
莫问
赞同来自:
- /BOOL/textView:/UITextView */textView shouldChangeTextInRange:/NSRange/range replacementText:/NSString */text { // Any new character added is passed in as the "text" parameter if/[text isEqualToString:@"\n"]/ { // Be sure to test for equality using the "isEqualToString" message [textView resignFirstResponder]; // Return FALSE so that the final '\n' character doesn't get added return NO; } // For any other character return TRUE so that the text gets added to the view return YES; }
风见雨下
IBAction
UITextfield
DidEndOnExit
[textViewName resignFirstResponder]
[self.view endEditing:YES]
石油百科
Done
myTextView
UITextView
-/BOOL/textViewShouldReturn:/UITextView*/textView { if /textView == myTextView/ { [textView resignFirstResponder]; } return YES; }
touchUpInside:
-/IBAction/dismissKeyboard:/id/sender;
-/IBAction/dismissKeyboard:/id/sender { [myTextView resignFirstResponder]; }
小明明
resignFirstResponder
要回复问题请先登录或注册
4 个回复
莫问
赞同来自:
我遵循这一点来从键盘辞职 UITextview, 如果有任何恐惧,请告诉我
谢
风见雨下
赞同来自:
和在 IB 将它连接到活动
's
. 然后打电话
[textViewName resignFirstResponder]
, 删除键盘。
或者,尝试使用
[self.view endEditing:YES]
在 IBAction.
石油百科
赞同来自:
键盘:
在这些例子中
- 这是
, 其中在标题中定义并连接到 Interface Builder.
要分配外部按钮:
务必确定
在他的标题然后在 Interface Builder 将按钮连接到此操作
.h
.m
小明明
赞同来自:
在 textview, 这具有拒绝键盘的焦点。