May have example of use : AddTab2 ?
Dim xTab As Tabs
xTab.Initialize
xTab.BackgroundColor = xui.Color_Black
xTab.BadgeVisible = True
xTab.Icon = Null
xTab.Index = -1 'is overwritten internally
xTab.TabText = "Test"
xTab.TextColor = xui.Color_White
xTab.TextIconPadding = 2dip
xTab.Visible = True
xTab.xFont = xui.CreateDefaultBoldFont(12)
ASTabMenu_horizontal.AddTab2(xTab)
How to make the text thin or not in bold format?
ASTabMenu_vertical.text_font = xui.CreateDefaultBoldFont(15)
ASTabMenu_vertical.GetTabProperties(0).xFont = xui.CreateDefaultBoldFont(15)
ASTabMenu_vertical.CommitChanges
then download it again.My tab text became bold after updating to version 1.32
You can add a code module with a function "CreateTabMenu" and then just pass the menu per parameter and make the settings you want to have there.if I want the same menu on several pages (not all)
do I have to recreate it for each page or can I somehow
always use the same one?
thank'sYou can add a code module with a function "CreateTabMenu" and then just pass the menu per parameter and make the settings you want to have there.
asTabMenu__main.BeginUpdateasTabMenu__main.AddTab(...)
asTabMenu__main.AddTab(...)
asTabMenu__main.TabTextColor = settings__UI__color__accent__default__text ' Default tab text color
asTabMenu__main.SelectedTabTextColor = settings__UI__color__accent__default ' Tab text color when selected
asTabMenu__main.setTabText(0, "Test0")
asTabMenu__main.setTabText(1, "Test1")
asTabMenu__main.CommitChanges
asTabMenu__main.EndUpdate
Private g_BadgeTopPadding As Float = 0
......
Public Sub setBadge_setTopPadding(padding As Float)
g_BadgeTopPadding = padding
End Sub
.....
else If g_badge_gravity = getBadge_TOPLEFT Then
xlbl_badge.SetLayoutAnimated(0,xpnl_base.Width/2 - icon_height/1.2 + g_BadgeLeftPadding,xpnl_base.Height/2 - icon_height + g_BadgeTopPadding,badge_height,badge_height)
else If g_badge_gravity = getBadge_TOPMIDDLE Then
xlbl_badge.SetLayoutAnimated(0,xpnl_base.Width/2 - badge_height/2 + g_BadgeLeftPadding,xpnl_base.Height/2 - icon_height + g_BadgeTopPadding,badge_height,badge_height)
else If g_badge_gravity = getBadge_TOPRIGHT Then
xlbl_badge.SetLayoutAnimated(0,xpnl_base.Width/2 + icon_height/1.2 - badge_height + g_BadgeLeftPadding, xpnl_base.Height/2 - icon_height + g_BadgeTopPadding ,badge_height,badge_height)
TabMenu.Badge_setVisibleEasy(1, 10, xui.Color_Red, xui.Color_White)
.....
Public Sub Badge_setVisibleEasy(index As Int,number As Int, color As Int, textсolor As Int)
Badge_setColor(index, color, textсolor)
Badge_setText(index,number)
Badge_setVisible(index,True)
End Sub
'gets or sets the badge color
Public Sub Badge_setColor(index As Int, color As Int, textсolor As Int)
Dim tmp_base As B4XView = xpnl_tabbase.GetView(index)
Dim xlbl_badge As B4XView = tmp_base.GetView(2)
xlbl_badge.Color = color
xlbl_badge.TextColor = textсolor
End Sub
change the badge so that I can display e.g. an FontAwesome Icon instead of a number?
ASTabMenu_horizontal.Badge_getLabel(0).Font = xui.CreateFontAwesome(15)
ASTabMenu_horizontal.Badge_getLabel(0).Text = Chr(0xF179)
Could you add this?:Update
- 1.34
- Add Badge_setTopPadding
- Add Badge_setTextColor
B4X:ASTabMenu_horizontal.Badge_getLabel(0).Font = xui.CreateFontAwesome(15) ASTabMenu_horizontal.Badge_getLabel(0).Text = Chr(0xF179)
what should i add?Could you add this?:
what should i add?
tmp_pnl.UserInteractionEnabled = enable