Is it possible to create something embedded like what is shown in the screenshot below? Instead of using `native.showPopup()`, which does a full screen takeover?
Edited by m.shoaib.mughal96, 02 January 2019 - 10:04 PM.
Jump to content
Sure. There are multiple ways to do this depending on what you're doing for scene management. For instance, if you're using Composer, you could do an overlay scene. There isn't a single API to do this. You would need a display.newRect() or two, some display.newText(), a native.newTextField() and a couple of widget.newButton()'s.
Thanks Rob for quick response but my question seems different than a simple overlay. Or may be it's have to use some native apis.
When I use native.showPopup() for the email. The compose email does a full screen takeover. I'm thinking to show a small popup window within my app to compose a new email for user. Is it possible to compose email with a custom overlay?
Thanks in Advance.
native.* API calls are really out of our control. You get what the OS gives you. We don't build or design those dialogs. There is not a UI tool that Corona has that lets you build native UI controls. Corona's drawing controls are done in an OpenGL canvas and features you create there blends in with your app. native.* will always sit on top of your app and are typically modal meaning they take over until they are dismissed.
You can attempt to mimic native type dialogs using Corona APIs and managing where touch controls happen. For instance you can make a full screen, half opacity black rectangle, draw it on top of your app and add a touch handler that absorbs any touches or taps, then draw your partial screen box on top and add your UI elements to it. Since your input is done with a native.* API it will sit on top of everything else. If you don't want this to be modal, leave off the touch handlers on the background rectangle. Don't want your partial screen to block your main app? Don't create the background at all.
Community Forum Software by IP.Board