ios - button状态改变问题
PHPz
PHPz 2017-04-18 09:50:24
0
2
552

button原始selected为no,前面判断语句也显示其为no,当点击这个按钮的时候,self.btn.selected = !=self.btn,selected,再次判断判断这个btn还是no,再点一次才为selected,变为normal也要点两次,什么原因,大神求解

PHPz
PHPz

学习是最好的投资!

reply all(2)
洪涛

Isn’t it supposed to be like this
self.btn.selected = !self.btn.selected;

Peter_Zhu

First, you set different colors for the two states of the button, and execute the following sentence in the click event of the button. If the colors change each other, there will be no problem.

self.btn.selected = !self.btn.selected;
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template