- (void)ButTouch:(UIButton *)btn
{
btn.selected = !btn.selected;
if (btn.selected)
{ [btn setBackgroundColor:[UIColor blueColor]];
NSLog(@"----------1-1-----");
}
else
{
btn.backgroundColor = [UIColor redColor];
NSLog(@"---------222-----");
}
}
- (void)ButTouch:(UIButton *)btn
{
btn.selected = !btn.selected;
if (btn.selected)
{ [btn setBackgroundColor:[UIColor blueColor]];
NSLog(@"----------1-1-----");
}
else
{
btn.backgroundColor = [UIColor redColor];
NSLog(@"---------222-----");
}
}
本文标题:自定义按钮
本文链接:https://www.haomeiwen.com/subject/ecpdgxtx.html
网友评论