zoukankan      html  css  js  c++  java
  • UITextfield的一些属性

    //设置左视图 不用设置frame

     UIImageView *imageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"phoneIcon@x"]];

        self.infoText.leftView = imageV;

        self.infoText.leftViewMode = UITextFieldViewModeAlways;

    //如果是button带点击事件 不设置frame 视图不能上显示

        self.secureBtn = [UIButton buttonWithType:UIButtonTypeSystem];

        self.secureBtn.frame = CGRectMake(0, 0, self.pwdText.width / 8, self.pwdText.height);

        [self.secureBtn setBackgroundImage:[UIImage imageNamed:@"btn_password_hidden@3x"] forState:UIControlStateNormal];

        [self.secureBtn addTarget:self action:@selector(hiden) forControlEvents:UIControlEventTouchUpInside];

        self.pwdText.rightView = self.secureBtn;

        self.pwdText.rightViewMode = UITextFieldViewModeAlways;

    //设置占位符 颜色默认

    self.pwdText.Placeholder = @"请输入密码";

    //设置占位符的颜色

    self.pwdText.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入密码" attributes:

    //设置是否是一次性清除按钮

    self.infoText.clearButtonMode = YES;//设置

    //设置是否隐藏密码

    self.pwdText.secureTextEntry = YES ;//隐藏

  • 相关阅读:
    What's New In Python 3.X
    CSS Transform Style
    Build Laravel Blog PigJian by PHP7 and Nginx on Ubuntu
    常见算法之2---排序数组中和为给定值的两个数字
    常见算法之1---先序遍历二叉树
    常见算法之0---冒泡排序
    UVa 341
    UVa 558
    UVa 11747
    UVa 11631
  • 原文地址:https://www.cnblogs.com/wujie123/p/5361001.html
Copyright © 2011-2022 走看看