Hi,
After days of trying to figure out why my text fields (native.newTextField) aren’t alway visible when
I change screens (my version of scenes, not the SDK’s), I finally boiled it down to:
t = native.newTextField (x, y, w, 30) -- field for a URL t.isVisible = true -- SS kludge, not needed on simulator! show\_msg ("url vis: " .. fmt\_tf (t.isVisible))
(“show_msg” displays the string to the device screen.)
On a Samsung Galaxy S7 (Android 7.0) (and a few others with older Android releases), I get this on the screen:
url vis: false
Which is quite unexpected, and wrong!
On the simulator, that “show_msg” reports true.
(BTW, devices and simulator act as described above with and without that “t.isVisible = true” line.)
Is native.newTextField malfunctioning, or is there something obvious I’m missing?
Since my version of scene switching relies on checking all my gui objects and recording their
current “isVisible” state, if a visible object *lies* and says it isn’t visible, then later when I
change to the state that should display it, it won’t be seen… because I erroneously thought it hadn’t been visible.
If “isVisible” is going to lie to me, then … argh! (Yeah, I can work around it, by tracking what I think the visibility should be, and simply never fetching isVisible, ever.)
Attached: tiny example (source, zipped), as test0.zip
Use: simply run it, and look for the text in middle of screen.
thanks,
Stan