自定义按钮

- (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-----");

}

}

你可能感兴趣的:(自定义按钮)