//UIColor *color1 = [UIColor colorWithPatternImage:[UIImage imageNamed:@"left1.png"]]; //UIColor *color2 = [UIColor colorWithPatternImage:[UIImage imageNamed:@"left2.png"]]; //[contactBookBtn setBackgroundColor:color1]; [contactBookBtn setBackgroundImage:[UIImage imageNamed:@"left1.png"] forState:UIControlStateNormal]; [contactBookBtn setBackgroundImage:[UIImage imageNamed:@"left2.png"] forState:UIControlStateSelected]; //[contactBookBtn setTitleColor:color1 forState:UIControlStateNormal]; //[contactBookBtn setTitleColor:color2 forState:UIControlStateSelected]; //[cell.selectOrNot setImage:[UIImage imageNamed:@"gou.png"]forState:UIControlStateNormal ] ;
转载于:https://www.cnblogs.com/qingjoin/archive/2012/09/25/2701074.html
UIButton背景图片设置
本文介绍如何使用Objective-C为UIButton设置不同状态下的背景图片,包括默认状态和选中状态,通过UIImage和UIButton的方法实现按钮外观的自定义。
1677

被折叠的 条评论
为什么被折叠?



