
代码的话,创建用:
UIButton *button = [[UIButton alloc]initWithFrame:CGRectMake(0,0,200,80)]]
0,0,200,80自己改合适位置。
vc 里显示用:
[self.view addSubview:button]
响应的话:
[button addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside]
buttonClicked 函数记得要写。
代码方法:btn.layer.cornerRadius=5.0fxib 选中button ->User Defined Runtime Attributes 哪里设置 key Path : “ layer.cornerRadius ” value 设置成 5.0
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)