iOS設置一個圓角button遇到的問題

//設置一個圓角button的時候設置了背景圖片
 [saveButton setBackgroundImage:[UIImage imageNamed:@"green_btn_bg"] forState:UIControlStateNormal];
 //這個屬性實效了
 [UIButton buttonWithType:UIButtonTypeRoundedRect]
 //解決方法:
  [saveButton.layer setMasksToBounds:YES];
  [saveButton.layer setCornerRadius:8.0];
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章