button原始selected为no,前面判断语句也显示其为no,当点击这个按钮的时候,self.btn.selected = !=self.btn,selected,再次判断判断这个btn还是no,再点一次才为selected,变为normal也要点两次,什么原因,大神求解
学习是最好的投资!
Isn’t it supposed to be like thisself.btn.selected = !self.btn.selected;
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;
Isn’t it supposed to be like this
self.btn.selected = !self.btn.selected;
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.