The first step:
_RIGHTBTN = [UIButton buttonwithtype:uibuttontypecustom]; 57, Kwidth-_tf.frame.size.width-); [_rightbtn setbackgroundimage:[uiimage imagenamed:@ "send_un"] forstate: UIControlStateNormal]; [_rightbtn addtarget:self Action: @selector (Btnclick:) forcontrolevents:uicontroleventtouchupinside]; [_inputview addsubview:_rightbtn];
Step Two:
// Monitor the input status of the TextField [[Nsnotificationcenter defaultcenter] addobserver:self selector: @selector (textfielddidchangevalue:) name:uitextfieldtextdidchangenotification object: _TF];
Step Three:
//Here you can get the Uitextfield object specified at the time of registration by sending an object message- (void) Textfielddidchangevalue: (Nsnotification *) notification{Uitextfield*sender = (Uitextfield *) [NotificationObject]; if(Sender.text.length! =0) {[_rightbtn setbackgroundimage:[uiimage imagenamed:@"Send"] Forstate:uicontrolstatenormal]; }Else{[_rightbtn setbackgroundimage:[uiimage imagenamed:@"Send_un"] Forstate:uicontrolstatenormal]; }}
And simple, just do the recording!
iOS Development-determine the status of a button by notifying the input status of the TextField