I’m trying to write a settings screen for my app, but I cannot get the switch widget to look good. Here’s a minimized code of what I’m doing (a white screen with a switch (check box) and a text):
local w = display.contentWidth local h = display.contentHeight local widget = require( "widget" ) local rect = display.newRect(w/2, h/2, w, h) rect:setFillColor(1) -- Create the widget local switch = widget.newSwitch { left = 50, top = 100, style = "checkbox" } local txt = display.newText("Checkbox text", 90, 118, native.systemFontBold, 32 ) txt:setFillColor(0) txt.anchorX = 0
Unfotunately, what I get on the simulator and what I get on the actual device is very different:
As you can see, the size of the switch is ok on the simulator, but almost impossible to see/hit on the Android device.
Is there some way of setting the size of this widget? Am I doing something wrong?