禁止键盘输入表情
来源:互联网 发布:淘宝童装模特女孩 编辑:程序博客网 时间:2024/04/18 05:47
#import"ViewController.h"
@implementationViewController
{
IBOutletUITextView *textinput;
}
-(void)viewDidLoad
{
[superviewDidLoad];
[textinputsetDelegate:self];
}
-(void)textViewDidChange:(UITextView *)textView
{
NSRangetextRange = [textView selectedRange];
[textViewsetText:[self disable_emoji:[textView text]]];
[textViewsetSelectedRange:textRange];
}
-(NSString *)disable_emoji:(NSString *)text
{
NSRegularExpression*regex = [NSRegularExpression regularExpressionWithPattern:@"[^\\u0020-\\u007E\\u00A0-\\u00BE\\u2E80-\\uA4CF\\uF900-\\uFAFF\\uFE30-\\uFE4F\\uFF00-\\uFFEF\\u0080-\\u009F\\u2000-\\u201f\r\n]"options:NSRegularExpressionCaseInsensitive error:nil];
NSString*modifiedString = [regex stringByReplacingMatchesInString:text
options:0
range:NSMakeRange(0,[text length])
withTemplate:@""];
returnmodifiedString;
}
- 禁止键盘输入表情
- 禁止输入表情
- ios禁止表情输入
- 禁止表情输入
- edittext禁止输入表情
- EditText禁止输入表情
- EditText禁止输入表情
- 禁止输入表情
- ios 禁止输入表情
- 禁止输入表情
- Android 禁止emoji 表情
- ios 禁止输入表情
- ios上禁止输入表情
- iOS禁止输入emoji表情
- iOS禁止输入emoji表情
- 禁止输入表情的EditText
- 自定义EditText禁止输入表情
- Android EditText 禁止输入表情
- GRE写作必备句型
- 关于struct的细节
- 类的匿名对象管理模型
- 环境互换
- [Objective-C] send message 和 call method 的区别
- 禁止键盘输入表情
- 17.合并两个排序的链表
- ImageView.ScaleType设置图解
- u-boot 4、u-boot.lds
- 使用简单的html+css+javacsript实现dialog功能
- memcached全面剖析–2.理解memcached的内存存储
- Java中的值传递和引用传递
- java socket编程
- 【java】 iText使用PDF模板生成输出PDF