textfield是什么意思啊

互联网 19-5-6

textfield的意思为“文本框;文本域;文本字段;文本区;文字字段”,它是java Swing桌面应用中的一个文本框组件,能够实现文本的输入和输出,textfield有许多功能方法可以使用,丰富组件。

textfield有许多功能方法,这里介绍一部分:

UITextField *text = [[UITextField alloc]initWithFrame:CGRectMake(20, 20, 130, 30)];
text.borderStyle = UITextBorderStyleRoundedRect; typedef enum { UITextBorderStyleNone, UITextBorderStyleLine, UITextBorderStyleBezel, UITextBorderStyleRoundedRect } UITextBorderStyle;
text.backgroundColor = [UIColor whiteColor];
text.background = [UIImage imageNamed:@"dd.png"];
text.disabledBackground = [UIImage imageNamed:@"cc.png"];
text.placeholder = @"password";
text.font = [UIFont fontWithName:@"Arial" size:20.0f];
text.textColor = [UIColor redColor];
text.clearButtonMode = UITextFieldViewModeAlways; typedef enum {UITextFieldViewModeNever,  重不出现UITextFieldViewModeWhileEditing,  编辑时出现UITextFieldViewModeUnlessEditing,  除了编辑外都出现UITextFieldViewModeAlways  一直出现} UITextFieldViewMode;
text.text = @"一开始就在输入框的文字";
text.secureTextEntry = YES;
text.autocorrectionType = UITextAutocorrectionTypeNo; typedef enum {UITextAutocorrectionTypeDefault,  默认UITextAutocorrectionTypeNo,  不自动纠错UITextAutocorrectionTypeYes,  自动纠错} UITextAutocorrectionType;
text.clearsOnBeginEditing = YES;
text.textAlignment = UITextAlignmentLeft;
text.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
textFied.adjustsFontSizeToFitWidth = YES;
text.minimumFontSize = 20;
text.keyboardType = UIKeyboardTypeNumberPad; typedef enum {UIKeyboardTypeDefault,  默认键盘,支持所有字符UIKeyboardTypeASCIICapable,  支持ASCII的默认键盘UIKeyboardTypeNumbersAndPunctuation,  标准电话键盘,支持+*#字符UIKeyboardTypeURL,  URL键盘,支持.com按钮 只支持URL字符UIKeyboardTypeNumberPad,  数字键盘UIKeyboardTypePhonePad,  电话键盘UIKeyboardTypeNamePhonePad,  电话键盘,也支持输入人名UIKeyboardTypeEmailAddress,  用于输入电子 邮件地址的键盘UIKeyboardTypeDecimalPad,  数字键盘 有数字和小数点UIKeyboardTypeTwitter,  优化的键盘,方便输入@、#字符UIKeyboardTypeAlphabet = UIKeyboardTypeASCIICapable,} UIKeyboardType;
text.autocapitalizationType = UITextAutocapitalizationTypeNone; typedef enum {UITextAutocapitalizationTypeNone,  不自动大写UITextAutocapitalizationTypeWords,  单词首字母大写UITextAutocapitalizationTypeSentences,  句子的首字母大写UITextAutocapitalizationTypeAllCharacters,  所有字母都大写} UITextAutocapitalizationType;
text.returnKeyType =UIReturnKeyDone; typedef enum { UIReturnKeyDefault, 默认 灰色按钮,标有 ReturnUIReturnKeyGo, 标有Go的蓝色按钮UIReturnKeyGoogle, 标有Google的蓝色按钮, 用语搜索UIReturnKeyJoin,  标有Join的蓝色按钮UIReturnKeyNext,  标有Next的蓝色按钮UIReturnKeyRoute,  标有Route的蓝色按钮UIReturnKeySearch,  标有Search的蓝色按钮UIReturnKeySend,  标有Send的蓝色按钮UIReturnKeyYahoo,  标有Yahoo的蓝色按钮UIReturnKeyYahoo,  标有Yahoo的蓝色按钮UIReturnKeyEmergencyCall,  紧急呼叫按钮} UIReturnKeyType;
textView.keyboardAppearance=UIKeyboardAppearanceDefault; typedef enum  {UIKeyboardAppearanceDefault,  默认外观,浅灰色UIKeyboardAppearanceAlert, 深灰 石墨色 } UIReturnKeyType;
text.delegate = self;
[self.window addSubview:text];
UIImageView *image=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"right.png"]]; text.rightView=image; text.rightViewMode = UITextFieldViewModeAlways;

以上就是textfield是什么意思啊的详细内容,更多内容请关注技术你好其它相关文章!

来源链接:
免责声明:
1.资讯内容不构成投资建议,投资者应独立决策并自行承担风险
2.本文版权归属原作所有,仅代表作者本人观点,不代表本站的观点或立场
标签: textfield
上一篇:php获取远程图片并下载保存到本地的方法分析 下一篇:Servlet的功能是什么

相关资讯