This button iOS does not have a native effect.
This effect can be achieved by clicking the button's different click states.
The code is as follows:
_WORKBTN =[UIButton Buttonwithtype:uibuttontypecustom]; [_workbtn setimage:[uiimage imagenamed:@"Xuanxiang_hui"] Forstate:uicontrolstatenormal]; [_workbtn setimage:[uiimage imagenamed:@"Xuanxiang_lv"] forstate:uicontrolstateselected]; [Self.contentview ADDSUBVIEW:_WORKBTN]; [_workbtn mas_makeconstraints:^ (Masconstraintmaker *Make ) {Make.right.equalTo (worklb.left). Offset (-6); Make.size.equalTo (Cgsizemake ( -, -)); Make.centerY.equalTo (Self.centery); }]; _workbtn.selected= YES;
Another confusing place if TableView uses the custom cell
If the
The Cellforrowatindexpath method uses cell.textLabel.text = @ "";
will cause a position offset
However, you can use Self.textLabel.text = @ "In the overridden Init method
It's supposed to be internal logic, and beginners don't really understand that.
iOS check box