如何设置aUIButton的颜色?

use*_*026 5 uibutton ios

知道如何设置UIButton的背景颜色吗?

我试着用

self.sendButton.backgroundColor = [UIColor greenColor];
Run Code Online (Sandbox Code Playgroud)

但它不起作用.

Bob*_*con 7

您需要使用自定义按钮.您可以将图像设置为背景或定义UIColor.

看看这些链接:

Iphone UIButton背景颜色

是否可以更改UIButtons背景颜色?