美文网首页iOS
自定义按钮

自定义按钮

作者: 说不出口的喵 | 来源:发表于2017-12-26 11:06 被阅读14次

- (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