I'm trying to build a message window with App Bar on the top
This screen consist of Gluon App Bar on the top and VBox in bottom which has rest of the element shown in the screen.
Issue is when i click on the text area to enter text the App Bar goes out of scope.
Is there a way I can set App Bar to be always on top?
If you are deploying your app on Android, the
TextField
andTextArea
controls include a built-in check: when those input controls get focused, if required the scene is moved up to prevent the software keyboard from hiding the control.These translation affects the whole scene, so all the nodes in it (
View
,VBox
,TextField
,TextArea
,AppBar
, ...), will be translated as well.So if you want to keep the
AppBar
node always visible and in the same top position, a possible fix could be counteracting that translation whenever it happens.If you have a
BasicView
for instance (Gluon IDE plugin -> single view project), with aTextField
control at the bottom of the view:you can modify it like this:
Make sure that the view is already added to the scene when you add this binding (to prevent a NPE).
Now when the textfield gets the focus, the whole scene will be moved up, and the appBar will be moved down the same amount: