文章标题
来源:互联网 发布:守望先锋性能数据vrm 编辑:程序博客网 时间:2024/06/04 18:12
- UITextField
注:在.h文件中声明UITextFieldDelegage
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(10, 74, self.view.frame.size.width - 20, 31)];textField.borderStyle = UITextBorderStyleRoundedRect;textField.placeholder = @"...";textField.clearButtonMode = UITextFieldViewModeWhileEditing;textField.secureTextEntry = YES;textField.keyboardType = UIKeyboardTypeEmailAddress;textField.returnKeyType = UIReturnKeyGo;textField.textColor = [UIColor cyanColor];textField.font = [UIFont boldSystemFontOfSize:16.0f];textField.delegate = self;textField.contentVerticalAlignment = UIViewContentModeCenter;[self.view addSubview:textField];
UITextField delegate
- (BOOL)textFieldShouldEndEditing:(UITextField *)textField- { - return Yes;- }- (void)textFieldDidEndEditing:(UITextField *)textField- {- }- (BOOL)textFieldShouldReturn:(UITextField *)textField- { - [textField resignFirstResponder]; - return YES;- }
-UITextView
在.h文件中声明UITextViewDelegate
UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(x, y, width, height)];textView.backgroundColor = [UIColor redColor];textView.textColor = [UIColor blackColor];textView.keyboardType = UIKeyboardTypeEmailAddress;textView.returnKeyType = UIReturnKeyGo;textView.delegate = self;[self.view addSubview:textView];
UITextView delegate
- (void)textViewDidEndEditing:(UITextView *)textView- { - - }- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text- { - if (text isEqualToString:@"n"]) { - [textView resignFirstResponder]; - return NO; - } - return YES;- }
0 0
- 文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题 文章标题 文章标题 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- sql内置函数pivot强大的行转列功能
- 黑马程序员--自学笔记--反射
- python--自动删除文件
- 利用scp 远程上传下载文件/文件夹
- TextView 添加链接
- 文章标题
- DEELX 正则表达式扩展语法:递归表达式
- 时间都去哪了
- ping命令是什么协议?
- 关于Android生命周期方法调用return的问题
- 重启、蓝屏等 导致Android Stuido 发生"cannot resolve symbol" 解决方案
- AppStore上传不成功但是没有提示
- android源码解析--AlertDialog及AlertDialog.Builder
- 关于在5.0上沉浸式布局虚拟按键的问题