iPhone:使用XIB通过完成按钮操作重新启动键盘 [英] iPhone: Resign Keyboard with Done button action with XIB

查看:111
本文介绍了iPhone:使用XIB通过完成按钮操作重新启动键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我正在使用UITextview

hi i am working on UITextview

如何在键盘完成按钮后点击动作,单击动作,哪个XIB

how to Resign Keyboard, after keyboard "Done button" click Action, which XIB

谢谢

推荐答案

如果您想要答案,请使用默认的完成按钮重新设置UITextview的键盘在键盘上,那么这就是答案

hi if you want answer for, Resign the keyboard of UITextview with default "Done" button on keyboard, then this is answer for that

- (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;
}

我按照这个来重新签名UITextview的键盘,如果有任何疑虑通知我

i followed this to resign keyboard of UITextview, if there is any concern inform me

谢谢

这篇关于iPhone:使用XIB通过完成按钮操作重新启动键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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