Android Tutorial ScrollView example with a Panel higher than the screen

Attached you find an example with a ScrollView with a Panel higher than the screen.

The layouts are designed in the Designer, not in the code.

There are 2 layout files:
- Main with the ScrollView.
- ScrollViewLayout has one Panel higher than the screen, 7 Label views and 7 EditText views, the Panel height is set so the last EditText view is on top of the screen when the panel's lower edge is on the lower edge of the screen.

Clicking on an EditText moves the Scrollview up to show this EditText view on top of the screen to avoid interference with the virtual keyboard.

Best regards.
 

Attachments

  • ScrollViewBigPanel1.jpg
    ScrollViewBigPanel1.jpg
    18.3 KB · Views: 22,869
  • ScrollViewBigPanel2.jpg
    ScrollViewBigPanel2.jpg
    28.6 KB · Views: 21,944
  • ScrollViewBigPanel.zip
    8.8 KB · Views: 1,145
Last edited:

hibrid0

Active Member
Licensed User
Longtime User
Hi I follow this for my small project, I create the layaout for load on the scrollview, that work fine.
Create a script on designer for the layout for load on the scrollview, but when I run the app, all views on the layout are not in order like the script, just like put on the designer.
I reply to my question:

If you want to load a layout file (with a script) to the inner panel then you will need to first set the panel width: ScrollView.Panel.Width = ScrollView.Width.

Source:
https://www.b4x.com/android/forum/threads/designer-scripts-tutorial.16120/
 
Top