您的位置:首页 > 产品设计 > UI/UE

UIButton

2015-08-27 09:36 507 查看
UIButton相关代码如下:

UIButton *fistBt = [[UIButton alloc] initWithFrame:CGRectMake(10, 130, SCREEN_WIDTH/2 - 25, 40)];
[fistBt.layer setCornerRadius:5];
[fistBt setTitle:@"取消" forState:0];
[fistBt setTintColor:RGB(255, 106, 34)];
[fistBt setBackgroundColor:[UIColor lightGrayColor]];
[fistBt addTarget:self action:@selector(fistClick) forControlEvents:UIControlEventTouchUpInside];
给button添加图片

//设置button填充图片,不会拉伸控件
[button1 setImage:[UIImage imageNamed:@"btng.png"] forState:UIControlStateNormal];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: