參考:
如果想要變化順滑一點(diǎn)谣殊,可以加個(gè)動(dòng)畫孝凌。比如:
- (void)clickSelectBtn:(UIButton *)btn{
btn.selected = !btn.selected;
if (btn.selected == YES) {
// 改變箭頭
[UIView animateWithDuration:0.5 animations:^{
btn.imageView.transform = CGAffineTransformRotate(btn.imageView.transform, M_PI);
}];
} else {
[UIView animateWithDuration:0.5 animations:^{
btn.imageView.transform = CGAffineTransformRotate(btn.imageView.transform, -M_PI);
}];
}
}