Android Question [ASTabMenu] Custom tab

angel_

Well-Known Member
Licensed User
Longtime User
At some point the library has changed and now it doesn't work as I used to customize the tabs.

After loading the layouts by tabstrip, I call:

B4X:
TabStrip.Initialize(ASTabMenu1, ASViewPager1)
...
TabStrip.AddPage
...
CustomTab
B4X:
Sub CustomTab(TabMenu As ASTabMenu)
    TabMenu.TabStripMode = True
    TabMenu.text_font = xui.CreateFont2(CustomFontB4X, TabMenu.text_font.Size * 0.8)
    TabMenu.TabTextColor = xui.Color_Gray
    TabMenu.SelectedTabTextColor = xui.Color_Green
    TabMenu.UnderLineHeight = 5dip
    TabMenu.UnderLineColor = xui.Color_LightGray
    TabMenu.SetTab(TabMenu.CurrentIndex, False, False)
    TabMenu.CommitChanges
End Sub

The main problems are that it does not take the text size well and only changes the color of the tab text when selecting a tab and not when starting

What is the best way to customize tabs?

Edit: I go back to version v1.24 and it works fine. Is it possible to use the above code in the new version?
 
Last edited:

Alexander Stolte

Expert
Licensed User
Longtime User
What is the best way to customize tabs?
B4X:
ASTabMenu_vertical.text_font = xui.CreateDefaultBoldFont(15)
Add this code before you add tabs
or
B4X:
ASTabMenu_vertical.GetTabProperties(0).xFont = xui.CreateDefaultBoldFont(15)
ASTabMenu_vertical.CommitChanges
if you only want to change one specific tab
 
Last edited:
Upvote 0

angel_

Well-Known Member
Licensed User
Longtime User
Thanks for your support, but it still doesn't work, the color of the text and putting a custom font doesn't work either

B4X:
TabStrip.Initialize(ASTabMenu1, ASViewPager1)
ASTabMenu1.text_font = xui.CreateDefaultBoldFont(8)
...
TabStrip.AddPage
...
CustomTab
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 1.33
    • text_font renamed to TextFont
    • BugFixes

should work now
 
Upvote 0
Top