iOS UIButton添加圓角,添加邊框


//准備工作
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(50,50,100,40);
button.backgroundColor = [UIColor blueColor];
//關鍵語句
button.layer.cornerRadius = 2.0;//2.0是圓角的弧度,根據需求自己更改
button.layer.borderColor = [UIColor blackColor];//設置邊框顏色
button.layer.borderWidth = 1.0f;//設置邊框顏色

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM