zoukankan      html  css  js  c++  java
  • UITextField的属性设置

    1.背景颜色 field.backgoundColor = [UIColor redColor];

    2.设置field文字 field.text = @"输入文字";

    3.设置field的提示文字 field.placeholder = @"请输入用户名";

    4.设置field开始编辑时清除提示内容 field.clearsOnBeginEditing = YES;  

    5.设置field的文字大小 field.font = [UIFont systemFontOfSize:14];

    6.设置文字颜色 field.textColor = [UIColor redColor];

    7.设置文字对齐方式 field.textAlignment = NSTextAlignmentCenter;

    8.输入密码安全输入 field.secureTextEntry = YES;

    9.弹出键盘样式  field.keyBoardType = UIKeyBoardTypeAlphabet;

    10.设置field的键盘外观样式 field.keyBoardAppearance = UIKeyBoardAppearanceDefault;

    11.设置输入框的外观 field.borderStyle = UITextBorderStyleLine;

    12.输入框后面的清除按钮:field.clearButtonMode = UITextFieldViewModeUnlessEditing;

    13.弹出的键盘最后的return可改为其它的,next,search等  field.returnKeyType = UIReturnKeyNext;

    14.自定义弹出视图: field.inputView

    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 200)];

    view.backgroundColor = [UIColor grayColor];

    field.inputView = view;

    [view release];

    15.弹出一个辅助视图:field.inputAccessoryView

    UIView *supView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0,30)];

    supView.backgroundColor = [UIColor darkGrayColor];

    field.inputAccessoryView = supView;

  • 相关阅读:
    java实现字符串和LIST,MAP转换
    JAVA发送HttpClient请求及接收请求结果
    JVM内存溢出分析
    tomcat启动问题 严重: End event threw exception
    解决oracle11G密码过期问题
    查看和开启服务器端口
    tongweb安装后无法启动问题
    intellij与eclipse默认快捷键对比
    java实现pdf按页切分成图片
    ORACLE在IMP时候出现数据丢失
  • 原文地址:https://www.cnblogs.com/lion-witcher/p/5078332.html
Copyright © 2011-2022 走看看