I must be missing something very simple - probably to do with Lua more than Corona - but I am having a lot of trouble with button images. I am using build 1076.
In the WidgetDemo example, file tab1.lua:
[lua] – Back button
local backButton = widget.newButton
{
width = 198,
height = 59,
label = “Back”,
onRelease = goBack
}
[/lua]
Where is the button image coming from? After looking at the widgets api docs, I still do not understand how the WidgetDemo example works. The docs mention a default “widget_theme_ios” but the WidgetDemo only has a “theme_ios”(.lua) file. The theme_ios.lua file says to use something like:
[lua]
local button = widget.newButton{ style=“blue1Small” }
[/lua]
…but doing this does not change the button image in the WidgetDemo. Further, renaming or deleting the button images (…widget_ios\button\default.png etc.) doesn’t seem to make any difference to the example - it still gets a button image from somewhere - where??
Can someone please explain the relationship between widgets, theme_ios.lua, widget_theme_ios.lua, the “style” table in the theme file, where the actual button graphics come from, and if there is a better example, ideally with some 9-slice buttons etc. Also the WidgetDemo button image seems to change size according to the width & height parameters, but from the API docs this shouldn’t be the case?
Any help much appreciated, because I’m feeling very confused!
Kevin.