iOS设置一个圆角button遇到的问题

来源:互联网 发布:mac版office威锋 编辑:程序博客网 时间:2024/06/01 08:12
//设置一个圆角button的时候设置了背景图片 [saveButton setBackgroundImage:[UIImage imageNamed:@"green_btn_bg"] forState:UIControlStateNormal]; //这个属性实效了 [UIButton buttonWithType:UIButtonTypeRoundedRect] //解决方法:  [saveButton.layer setMasksToBounds:YES];  [saveButton.layer setCornerRadius:8.0];
1 0
原创粉丝点击