标签:cto elf make 透明 点击 target select pre control
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
1、按钮透明效果
btn.alpha = 0.8;
2、按钮圆角处理
btn.layer.cornerRadius = 5; btn.layer.masksToBounds = YES;
3、按钮文字字体大小(加粗)
btn.titleLabel.font = [UIFont boldSystemFontOfSize:13.0];
4、按钮文字、图片位置交换
btn.imageEdgeInsets = UIEdgeInsetsMake(0, 42, 0, -42); btn.titleEdgeInsets = UIEdgeInsetsMake(0, -8, 0, 8);
5、按钮点击
[btn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside];
标签:cto elf make 透明 点击 target select pre control
原文地址:http://www.cnblogs.com/sjxjjx/p/5997407.html