Android Question Scrollview/TabStrip

Lee Ingram

Member
Licensed User
I am trying to scroll text while also using TabStrip. I am trying to develop a TabStrip help menu. That will scroll through the text.
I been working this for days, I've gone through many many examples. I have three pages and
each page contain labels with multiline text. I am truly missing something, and I need HELP.

Zip file attached
 

Attachments

Lee Ingram

Member
Licensed User
What is the problem?
I am trying to scroll text while also using TabStrip. The selected text does not scroll completely, only a couple of lines. I have 3 tabs and each Tab has 3 or 4 buttons. Each Tab has 3 or 4 labels with text of varying lengths. I am trying to combine power of TabStrip and SrollView. I am also seeing a copy of the label in the foreground. I am so lost i am going in circles.
 

Erel

Administrator
Staff member
Licensed User
You are loading the same layout file twice.
B4X:
TabStrip1.LoadLayout("Page1", "2x2 HELP")
...
scvtest.Panel.LoadLayout("Page1")
This means that there will be two set of views. Is it intended?
 

Lee Ingram

Member
Licensed User
You are loading the same layout file twice.
B4X:
TabStrip1.LoadLayout("Page1", "2x2 HELP")
...
scvtest.Panel.LoadLayout("Page1")
This means that there will be two set of views. Is it intended?
OK, I have removed the
scvtest.Panel.LoadLayout("Page1")

I can see the scroll bar in the background, but the text does not scroll. I am truly missing something. I have been working on this for hours and I am not getting anywhere. My goal is to be able to scroll all of the Help texts. But I am not having any fun just trying to scroll one text label. I've tried various attempts of .Visible true/Visible false and .RemoveViews at many different places. I am truly missing something.
I have tried to glean what I could from B4A: Rapid Android Development using BASIC. The TabStrip work GREAT, but I would really like to scroll through the text with the same font size. Thank you, Lee
 

JohnC

Well-Known Member
Licensed User
I too am confused...

If you need to do a .LoadLayout to add a "page" to the TabStrip, then if that layout has a scrollview in it, then how can you also do a scrollview.panel.loadlayout to load a layout into the scroll view beause there doesn't appear to be a way to access the scrollview object after it's host layout is loaded in the Tabstrip.

Bascially, I would like to use the tabstrip to create a multi-page help system, and each "page" of help will have text that is taller/longer then the height of the tab's page, so I need to be able to allow the user to scroll the text on each of the tabstrip "pages", and I assume you need to use a scrollview to do the scrolling.

It would be nice if I could just have one layout that has a scrollview in it and load this same layout over and over again for the desired number of pages:

TabStrip1.LoadLayout("PageSV","About App")
TabStrip1.LoadLayout("PageSV","Features")
TabStrip1.LoadLayout("PageSV","FAQ")

And then it would be nice to have some sort of a routine that could access the scrollview in each page separately:

GetPageSV(1).Panel.LoadLayout("AboutText")
GetPageSV(2).Panel.LoadLayout("FeatureText")
GetPageSV(3).Panel.LoadLayout("FAQText")

If there is a way to modify the below routine (I got from another thread) so it can return a list of the scrollview controls in the tabstrip, then we could do the above to load a different layout into each scrollview:

B4X:
Public Sub GetAllTabLabels (tabstrip As TabStrip) As List
   Dim jo As JavaObject = tabstrip
   Dim r As Reflector
   r.Target = jo.GetField("tabStrip")
   Dim tc As Panel = r.GetField("tabsContainer")
   Dim res As List
   res.Initialize
   For Each v As View In tc
     If v Is Label Then res.Add(v)
   Next
   Return res

End Sub
 
Last edited:

Erel

Administrator
Staff member
Licensed User
@JohnCody please start a new thread for your question.

It is very simple to create scrollable text with TabStrip and CustomListView. Complete example with basically no code at all, is attached.
 

Attachments

Lee Ingram

Member
Licensed User
@JohnCody please start a new thread for your question.

It is very simple to create scrollable text with TabStrip and CustomListView. Complete example with basically no code at all, is attached.
THANK YOU, I am working on it now. I will be adding button for each TabStrip. Thank you again, Lee
 
Top