UIImage *yuyinImage = [UIImage imageNamed:@"yuyin.png"];
[soundButton setImage:yuyinImage forState:UIControlStateNormal];
[soundButton setImage:yuyinImage forState:UIControlStateSelected];
[soundButton setImage:yuyinImage forState:UIControlStateHighlighted];
//top left bottom right
[soundButton setImageEdgeInsets:UIEdgeInsetsMake(5, 5, 5, 15)];
NSString *soundButtonTitle = @"语音";
[soundButton setTitle:soundButtonTitle forState:UIControlStateNormal];
[soundButton setTitle:soundButtonTitle forState:UIControlStateSelected];
[soundButton setTitle:soundButtonTitle forState:UIControlStateHighlighted];
[soundButton setTitleEdgeInsets:UIEdgeInsetsMake(5, 10, 5, 0)];
[myButton setTitleEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; 4个参数是上边界,左边界,下边界,右边界。
UIButton左边图片右边文字的做法
原创lisiben ©著作权
文章标签 ii 文章分类 JavaScript 前端开发
-
poi-tl导出复杂word(图片、表格(合并单元格、嵌套图片)、文字)
java导出复杂word
List java 图片处理 -
如何实现按钮的图片在右边,文字在左边
按钮设置了文字和图片,若宽度足够展开的话,默认都是图片在作,文字在右。想文字在左,图片在右右两种方法。第一种方法很简单。通过设置
ios 按钮文字和图片 文字在左图片在右 ico