Android Question TabStripViewPager problems with positioning

FrankDev

Active Member
Licensed User
Longtime User
Hello, I use the

TabStripViewPager

and need to be able to change the width and height at runtime.
Unfortunately there is only the possibility to set the width and height in the designer.

I have already tried to put the whole thing in a panel and dock it in some way, but nothing works.

How do I get the properties High Width and Top?

Best regards
Frank
 

Mahares

Expert
Licensed User
Longtime User
How do I get the properties High Width and Top?
Are you talking about something like this Franky:
B4X:
For Each lbl As Label In GetAllTabLabels(TabStrip1)  'based on 5 tabs
        lbl.Width = 20%x
        lbl.Height=75dip
    Next
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)
     If v.Tag Is Label Then res.Add(v.Tag)
   Next
   Return res
End Sub
 
Upvote 0

FrankDev

Active Member
Licensed User
Longtime User
Hello @Mahares ,

Thank you very much for the feedback.
I don't want to know the diemensions of the tabs, but of the actual tabview.

I have created this in the designer.
My app calculates the individual coordinates of all the views and
repositions them if necessary.

Top, Left, Height, Width of this control can only be set in the designer ? not from my source.

Best regards
Frank
 
Upvote 0
Top