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 ;//隐藏

  • 相关阅读:
    Count on a Tree II
    DZY Loves Math
    二次剩余
    exCRT & 骆克强乘法
    CF 585 E Present for Vitalik the Philatelist
    Dirichlet 前缀和的几种版本
    51nod 1630(定积分 + 期望)
    Atcoder刷题小记
    3194. 【HNOI模拟题】化学(无标号无根树计数)
    3754. 【NOI2014】魔法森林(LCT)
  • 原文地址:https://www.cnblogs.com/wujie123/p/5361001.html
Copyright © 2011-2022 走看看