Android Question AS Sliding Onboard - Am I Missing the Obvious? B4X

Smee

Well-Known Member
Licensed User
Longtime User
Hello
I am reading through Alexander Stolte's Sliding Onboard Example and I am missing the obvious. I get that the page is composed of text and a graphic and they take half each, but how would I switch the positions given that the code for the top is set at 0 for both items?
B4X:
ImageView1.SetLayoutAnimated(0,0,0,Activity.Width,Activity.Height/2)

the GenImageViews routine looks very similar to the code for CreateListItem in ASViewPager

B4X:
       Dim p As B4XView = xui.CreatePanel("")
    p.SetLayoutAnimated(0, 0, 0, Width,Height)

What If I wanted to add say 3 items, either pictures or a custom list view say, one at the top taking 15% and the other 2 taking the rest of the screen equally

Many thanks for any help
:confused:

EDIT:
Not sure if bumping a post is allowed due to non replies. Please advise if this is the case

Thanks for any replies
 
Last edited:

Smee

Well-Known Member
Licensed User
Longtime User
Thanks For the reply Alexander,
I have a layout with three listviews that I want to position like so

1710750286849.png


when I create the list item with the sub

Private Sub CreateListItem(Text As String, Width As Int, Height As Int,Tag As Int) As B4XView
I pass the appropriate parameters.
In the above sub I have the 2 lines

B4X:
Private Sub CreateListItem(Text As String, Width As Int, Height As Int,Tag As Int) As B4XView
    Dim p As B4XView = xui.CreatePanel("")
    p.SetLayoutAnimated(0, 0, 0, Width, Height)
duration= 0 and left = 0 is fine but changing the top to any integer doesn't seem to change the location of the listview

Thanks again
 
Upvote 0
Top