Setting a background image for UIButton

后端 未结 7 1115
孤城傲影
孤城傲影 2020-12-17 14:59

I am a newbie with Objective C. How would I set the background of this button to an image (image is already in the resources folder in XCode, \"blue_button.png\") instead o

相关标签:
7条回答
  • 2020-12-17 15:51

    No need to set button to UIButtonTypeCustom - (void)setBackgroundImage:(UIImage *)image forState:(UIControlState)state method also works for UIButtonTypeRoundedRect

    0 讨论(0)
提交回复
热议问题