Android Question Need help with using ScrollView

trueboss323

Active Member
Licensed User
Hi all,
I am trying to write several paragraphs of labels inside a Scrollview which instruct the user how to use the app. But i cannot get the Scrollview to work properly. Can anyone help me? I am doing this all in the designer by the way.
 

trueboss323

Active Member
Licensed User
I also am using the StdActionBar library to display tabs. So obviously, I would like this to be loaded in the "Help" tab.
B4X:
Private bar As StdActionBar
    Private vp As StdViewPager
Dim ScrollView1 As ScrollView


vp.Initialize("vp", 5, 100%x, 100%y)



  
    Activity.AddView(vp.AsView, 0, 0, 100%x, 100%y)

bar.AddTab("Main")
bar.AddTab("Stats")
bar.AddTab("Options")
bar.AddTab("Help & About")
    bar.SelectedIndex = currentPage
vp.Panels(0).LoadLayout("Main")
    vp.Panels(1).LoadLayout("Stats")
    vp.Panels(2).LoadLayout("Options")
    vp.Panels(3).LoadLayout("Help")
  
bar.Initialize("bar")
    bar.NavigationMode = bar.NAVIGATION_MODE_TABS
    ' Add help Scrollview
    ScrollView1.Panel.LoadLayout("Help")
 

HotShoe

Well-Known Member
Licensed User

trueboss323

Active Member
Licensed User
That actually looks pretty good. But I do not need the top navigation buttons, since I only just need to load 1 file, and I would like to integrate the helpviewer inside the tab.
 

eurojam

Well-Known Member
Licensed User
I think you have to add your scrollview to the tab first:
B4X:
...
ScrollView1.Initialize(400dip)
vp.panels(3).AddView(ScrollView1,0,0,100%x,100%y)
ScrollView1.SetLayout("Help")
...
Just a suggestion, not tested.

stefan
 

trueboss323

Active Member
Licensed User
I changed your code to
B4X:
ScrollView1.Initialize(400dip)
vp.Panels(3).AddView(ScrollView1,0,0,100%x,100%y)
ScrollView1.Panel.LoadLayout("Help")
I could get the panel to load in the tab, but it won't scroll. Not sure if this is a designer problem or a coding problem.
 

eurojam

Well-Known Member
Licensed User
This is because of the
B4X:
ScrollView1.Initialize(400dip)
where the 400dip sets the height of the inner scrollpannel. If it will be less then the scrollpanelheight, there will be no scrolling...so set the inner height in relation to the views which you will have on the scrollviewpanel (depending from your layout)

regards
stefan
 
Top