Trying to use ScrollView with the designer and I failed to make it scroll
I build a screen full of UI elements and all it contained in two panels
I want to add a Scroll view that its height is as high as the overall components
and in case the screen is smaller than that the user can just scroll up and down
I added the scroll view (from the designer menu) , set its size etc
but I do not have an access to its panel (to add the UI components as childs) - am I doing something wrong ?
I went to the code activity create, after the loadLayout and did this
nothing happened (well I see a scroll and its moving but nothing is scrolled up / down
I tried to build the scrollview manually in code not in the designer, and to remove the designer built views from the activity (without that it did not worked as well)
I do not want to post my whole app - too much and the code is not shareable,
I'm trying to build a test project for it, and for some reason it fail on null pointer excpetion (code is almost the same as in my app which not failing)
anyway here it is, let me know if you can help or you need me to continue with it
MainPanel.Height is not yet known, it will be known only after having added the view.
I modified the code and load the layout file directly into the ScrollView.Panel and not in the Activity and remove all views.
The problem of not seeing anything in the ScrollView is the resizing in the Designer Scripts. Commenting all these lines shows all views.
In your case setting the Width property in the Designer Scripts results in a 0 value when loading the layout file into the ScrollView.Panel.
Setting the Left and Width properties in Designer Scripts with %x values sets these to 0 in the code.
Setting the Top and Height properties in Designer Scripts with %y values sets these to the percentage value in the code (90%y > 90).
Different behavior for x and y ?
would it be better to add the ScrollView.Panel to the designer so I can choose it as a parent for the other components I have ? and then everything will be done within the Designer ?
or remove the scroll view component from the designer all together ?