Android Question ScrollView Issue Panel.Height

Robert Valentino

Well-Known Member
Licensed User
Longtime User
I have a ScrollView that I've been using for some time and the height is of each entry is 50dip
and I normally use

B4X:
'  WindowInfoList is a list of of how many entries I added
'  PLC_Variables.EntryHeight is set to 50dip 

SVPlayerList.Panel.Height = (WindowInfoList.Size * PLC_Variables.EntryHeight)

If I change the PLC_Variables.EntryHeight to 40dip and run the same code (Just making the entries smaller) ScrollView will not scroll.

I need to add this code by Erl
(https://www.b4x.com/android/forum/t...after-panel-height-is-adjusted.49033/#content)
B4X:
       Dim jo As JavaObject = SVPlayerList.Panel
         jo.RunMethod("requestLayout", Null)

What gives. If I change the panel height back to 50dip I don't need that JavaObject "requestLayout" to scroll at 40dip, 45dip I do.

Can someone explain what "requestLayout" is doing? and when to use it. Should I do this ALL the time when setting the Panel.Height? I've had this problems in other parts of my code and could not understand why the window would not scroll.

Just seems like a bug in ScrollView to me

BobVal

PS: To anyone reading today Merry Christmas.
 

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Well I looked at CustomListView and now remember why I don't use it.

I know I must be a moron but for the life of me I cannot figure out how to position / resize this view.

There appears to be no way I can see to set top, left, width or height for within the program.

So how do I move this CLV or move it if the user has a smaller screen then I designed for (or larger).

In ScrollView this is real easy.

BobVal
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
I try to make all my screen displays work both Portrait and Landscape

I know that I can make two different looks in designer using variants.
But I find it so much easier to use one variant and move the fields around in code.

I found it strange that CustomListView did not conform to the same standards as all the other types of views (meaning left, top, width, height) and went on and started using ScrollView or ScrollView2D.

In another app I have a view where the user can select where on the screen they want things and drag them around if they want.
Just could not figure out a way to do that with CustomListView

I'm pretty happy with ScrollView (most of my apps aren't displaying lots of data).
Maybe someday someone will modify CLV to have positioning then I would consider converting.

By the way "Happy New Year" to you. I think this development environment you have given us is really top shelf

BobVal
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…