[B4X] [XUI] AS Tab Menu (Bottom Menu/Navigation)

pacoMx

Member
Licensed User
Longtime User
Hi, anyone having this one?
B4X:
B4A Version: 10.90
Parsing code.    Error
Error parsing program.
Error description: Undeclared variable 'iif' is used before it was assigned any value.
Error occurred on line: 475 (ASTabMenu)
Dim CurrentTabUnderlineAnimationDuration As Int = IIf(g_isInUpdate = False,g_CurrentTabUnderlineAnimationDuration,0)
 

pacoMx

Member
Licensed User
Longtime User
downlaod the lib. again. thanks.
Update
  • 1.24
    • core iif function is now used

Hi, still having same error (downloaded from 1st page of post, replaced external lib, opened project. Unchecked lib, saved, closed B4a, re-opened and chekecd lib).

Error is now shown on line 477
 

pacoMx

Member
Licensed User
Longtime User
Hi Alexander, thanks. I put an ASTabMenu in designer for page 2 and 3 and re-declare B4XPage_Created (AddTab) and ASTabMenu1_TabClick. But when I change between pages #2 and #3, underlined icon remains the same. If I click again on page tab is underlined correctly. Tried:
B4X:
    ASTabMenu1.AddTab(xui.Color_ARGB(255,39, 174, 97),"Page 1",ASTabMenu1.FontToBitmap(Chr(0xF015),False,30,xui.Color_White),"")
    ASTabMenu1.AddTab(xui.Color_ARGB(152,39, 174, 97),"Page 2",ASTabMenu1.FontToBitmap(Chr(0xF179),False,30,xui.Color_White),"")
    ASTabMenu1.AddTab(xui.Color_ARGB(255,39, 174, 97),"Page 3",ASTabMenu1.FontToBitmap(Chr(0xF11B),False,30,xui.Color_White),"")
    ASTabMenu1.SetTab(1, True, True) 'this is for page #2, on page #3 index is 2
What is it that I'm missing?
 

Lello1964

Well-Known Member
Licensed User
Longtime User
How change vertical space between icon and text ?

How change font size for each tab ?
 

Alexander Stolte

Expert
Licensed User
Longtime User
How change vertical space between icon and text ?
B4X:
ASTabMenu_vertical.TextIcon_Padding = 1.3 '1.3 is standard value
ASTabMenu_vertical.CommitChanges 'commit changes for all tabs
How change font size for each tab ?
B4X:
ASTabMenu_vertical.text_font = xui.CreateDefaultBoldFont(15) 'default value
ASTabMenu_vertical.CommitChanges 'commit changes for all tabs
 

Lello1964

Well-Known Member
Licensed User
Longtime User
B4X:
ASTabMenu_vertical.text_font = xui.CreateDefaultBoldFont(15) 'default value
ASTabMenu_vertical.CommitChanges 'commit changes for all tabs

the change is applied to all tabs, I need to change only one, some tabs text size 8 and some text size 14.
 

Alexander Stolte

Expert
Licensed User
Longtime User
I need to change only one, some tabs text size 8 and some text size 14.
Unfortunately, this is not possible, because at that time I always used only global variables, which then apply to all.
I would have to rewrite something. But unfortunately I can't do it today, because I'm not feeling well at the moment.
 

hanyelmehy

Active Member
Licensed User
Longtime User
i get this error when try to use Tab Menu

B4X:
Error occurred on line: 481 (ASTabMenu)[/SIZE][/HEADING]
java.lang.RuntimeException: Object should first be initialized (View).
i just add it to layout then load layout and use
B4X:
ASTabMenu1.BeginUpdate
ASTabMenu1.TabTextColor=Colors.DarkGray     ASTabMenu1.SelectedTabTextColor=Colors.Black
ASTabMenu1.AddTab(TabColor,"New",ASTabMenu1.FontToBitmap(Chr0xf055),False,30,TabiconColor),"1")

 

Lello1964

Well-Known Member
Licensed User
Longtime User
Unfortunately, this is not possible, because at that time I always used only global variables, which then apply to all.
I would have to rewrite something. But unfortunately I can't do it today, because I'm not feeling well at the moment.
Pls remeber my request.
 

epiCode

Active Member
Licensed User
Hi Alexander

I am using b4xlib from first post which shows version 1.24 in the manifest and 1.20 in the code. ( Should it matter? )
Also:
I'm using ASTabMenu with "Horizontal" and "text only" mode selected in Designer Custom Properties
mBase width is 360dip and height is 40dip yet the menu comes as vertical
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…