Panels create scrollbars in landscape

sahoopes

Member
Licensed User
Panels create scrollbars in landscape [Solution]

I'm using FormLib for a fullscreen app. I have sliding panels (animated). This means a panel starts outside the form and moves into the form.

First, all works as expected on desktop.

In portrait on device, all works as expected.

In landscape, the exact same code causes scrollbars to appear on the form. As soon as the panel becomes visible outside the screen scrollbnars appear. Then as the panel moves into the form the scrollbars decrease. Finally, as the panel is fully into the form, scrollbars disappear.

Not really a complaint as much as a curiousity. Wish I would have gotten a consistent result. I would've have liked to know that it wasn't going to work in landscape before I coded the whole project.
 
Last edited:

agraham

Expert
Licensed User
Longtime User
Sounds like in landscape mode Form.AutoScroll is being set to True. Download Erels' new Door library and add it as a Component. Make an object, say obj1, and try this code.

B4X:
obj1.New1(false)
obj1.FromControl("Form1")  ' or whatever your form is called
Msgbox(obj1.GetProperty("AutoScroll"))
' if it is in fact True then try setting it to false
obj1.SetProperty("AutoScroll",False)

EDIT :- obj1 should be an "Object" from the library http://www.b4x.com/forum/showthread.php?t=2038
 

sahoopes

Member
Licensed User
Thanks agraham. I was just looking at that and was going to ask how to do it. I really appreciate your help.
...
Just tested and works like a charm. Here's the simple code for everyone else:

Add Door.dll to your project. Use Add Object to add "Object" and call it obj1.

B4X:
obj1.New1(false)
obj1.FromControl("Form1")
...
Make sure form1 is visible first
...
if obj1.GetProperty("AutoScroll") = True then obj1.SetProperty("AutoScroll",False)

I guess you could just skip the test for True and set it to false always:

B4X:
obj1.SetProperty("AutoScroll",False)

Thank you agraham and Erel for the fix.
 
Top