Android Tutorial TabStripViewPager - Better ViewPager

Status
Not open for further replies.

jazzzzzzz

Active Member
Licensed User
Longtime User
I have 2 tabs in my tabstrip,I need the spacing between the tab names exactly as half,how can I do it?
Now the top bar is divded as length of tab name i think.but i need it as exactly half of device width irespective of display size ,like we give width of view as 50%x. As show in the attachment
 

Attachments

  • image.png
    3.5 KB · Views: 669

jazzzzzzz

Active Member
Licensed User
Longtime User

never mind,found the link

I think @Erel must add all this kind of code snippet links in main page itself.
https://www.b4x.com/android/forum/t...ger-better-viewpager.63975/page-4#post-421797
 

beeblomarv

Member
Licensed User
Longtime User
B4X:
Dim jo As JavaObject = tabstrip
jo.GetField("tabStrip").RunMethod("setIndicatorColor", Array(Colors.Red))

How to change the width* of Indicator! I mean how to make it wide or narrow?Just the width not the length -
 

beeblomarv

Member
Licensed User
Longtime User
Your indicator size is different! How did you manage to do that?
 

bjf

Member
Licensed User
Longtime User
How do you remove the tabstrip when in the same layout?
I populate it with 3 tabs in a search function.
Then if i go back to do another search it will populate the sam tabstrip with 3 ADDITIONAL tabs, not new ones.

I can't have the tabstrip in an separate layout due to problems displaying labels and text when i return from the separate layout.
 

wizard699

Active Member
Licensed User
Longtime User
Erel, I can't explore my tabscript with this code

TabStrip1.LoadLayout("lay_tabpagella_1", "Prove")

Dim jo As JavaObject = TabStrip1
Dim r AsReflector
r.Target = jo.GetField("tabStrip")
Dim tc AsPanel = r.GetField("tabsContainer")

Dim res AsList
res.Initialize

For Each v As View In tc
msgbox(v.tag, "test")
Next

lay_tabpagella_1 contains one Panel and a UltimateListView

What's wrong???
Thanks
 

JLS

Member
Licensed User
Longtime User
I'm trying to use the FontAwesome and Material Icons fonts, but I'unable.

I select them in the designer screen and I use TabStrip1.LoadLayout("01", "" & Chr(0xF063)) to set the icon, but nothing appears.

How could I do that.

Thanks in advance.
 

ilan

Expert
Licensed User
Longtime User
hi

when i set the background color of the labels (tabstrip page title) then i dont see an indicator.
what can i do to see the indicator?

thanx

ps: this is my code

B4X:
    Dim jo As JavaObject = TabStrip1
    Dim offset As Int = 33%x
    jo.GetFieldJO("tabStrip").RunMethod("setScrollOffset", Array(offset))
    jo.GetFieldJO("tabStrip").RunMethod("setIndicatorColor", Array(Colors.White))
   
    For Each v As View In GetAllTabLabels(TabStrip1)
       v.Width = 33%x
       Dim lbl As Label = v
       lbl.Gravity = Gravity.CENTER
       lbl.TextSize = 14
       lbl.Color = Colors.RGB(52,152,219)
       lbl.TextColor = Colors.White
    Next
 

MARCOS SANDRONI LIMA RIOS

New Member
Licensed User
Longtime User
not found theme.xml in example
res\values-v20\theme.xml:3: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Material.Light'.
 

MarcoRome

Expert
Licensed User
Longtime User
not found theme.xml in example
res\values-v20\theme.xml:3: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Material.Light'.

Hi. When you post error pls write more details.
What use example in #1 ?
Log Error ?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…