0

我是 Lua 的新手,使用 Corona,我无法弄清楚如何更改字体颜色。 color = { 163, 25, 12 }不起作用。

myButton = widget.newButton{
        id = "open_id",
        left = 12,
        top = 360, 
        label = "open",
        fontSize = 16,
    font = "Helvetica Neue Bold",
    color = { 163, 25, 12 },
        width = 294, 
        height = 40,
        cornerRadius = 2,
        onEvent = onButtonEvent
    }
4

2 回答 2

2

尝试这个:

myButton = widget.newButton{
    id = "open_id",
    left = 12,
    top = 360, 
    label = "open",
    fontSize = 16,
    font = "Helvetica Neue Bold",
    labelColor = { default = { 163, 25, 12 }, over = { 163, 25, 12} },
    width = 294, 
    height = 40,
    cornerRadius = 2,
    onEvent = onButtonEvent
}

看:

http://docs.coronalabs.com/api/library/widget/newButton.html

于 2012-12-24T03:36:51.760 回答
1

http://developer.coronalabs.com/reference/index/widgetnewbutton

标签颜色表。此表应包含标签颜色的红色、绿色、蓝色和 alpha 通道,处于“默认”和“过度”状态。这是一个示例表: { default={ 128, 255, 96, 255 }, over={ 0 } }

于 2012-12-17T08:31:12.540 回答