zoukankan      html  css  js  c++  java
  • 动态实时监听文本框中内容的变化

    @property (strong, nonatomic) UITextField *iPhoneText;

    @property (strong, nonatomic) UITextField *passwordText;

    @property (strong, nonatomic) UIButton *passwordBtn;

    viewdidLoad 中设置文本框的监听变化的方法

      [self.iPhoneText addTarget:self action:@selector(textChange) forControlEvents:  UIControlEventEditingChanged];

        [self.passwordText addTarget:self action:@selector(textChange) forControlEvents:UIControlEventEditingChanged];

        [self textChange];

    ///根据判断 text1与 text2是否有值

    -(void)textChange{

         self.loginBtn.enabled = self.iPhoneText.text.length && self.passwordText.text.length;

        [self.loginBtn setBackgroundColor:LoginButtonColor];

     }

  • 相关阅读:
    023 AQS--JUC的核心
    022 Future接口
    021 Callable接口
    020 线程的综合考虑
    019 线程协作
    命令,lldb,llvm,gdb,gcc,
    @class,import,
    arc,自动引用计数,
    写在哪里,
    40岁生日,
  • 原文地址:https://www.cnblogs.com/aiyiran/p/5030641.html
Copyright © 2011-2022 走看看