But that way I change the color of all the tab. I want to change the color of just a specific tab.
Public Sub setTabBG (index As Int, colour As Int)
Dim tmp_tab As B4XView = xpnl_tabbase.GetView(index)
tmp_tab.Color = colour
End Sub
MainTabMenu.setTabBG(0, Colors.Green)
Public Sub setTabBG (index As Int, colour As Int)
Dim tmp_tab As B4XView = xpnl_tabbase.GetView(index)
tmp_tab.Color = colour
End Sub
Public Sub getTabCount() As Int
Return xpnl_tabbase.NumberOfViews
End Sub
Public Sub getTabSelected() As Int
For i = 0 To getTabCount -1
Dim tmp_tab As B4XView = xpnl_tabbase.GetView(i)
Dim tmp_Text As B4XView = tmp_tab.GetView(0)
If tmp_Text.TextColor == g_SelectedTabTextColor Then
Return i
End If
Next
Return -1
End Sub
Public Sub setTabUnderlineSize(width As Int)
Dim tmp_tab As B4XView = xpnl_underline
If width = -1 Then
width = xpnl_tabbase.GetView(0).Width / 2
End If
tmp_tab.Left = xpnl_tabbase.GetView(getTabSelected).Left + ( xpnl_tabbase.GetView(getTabSelected).Width - width ) / 2
tmp_tab.Width = width
End Sub
You add the icon either while creating the Tab:Please how to change icons?
TabMenu.AddTab(xui.Color_ARGB(255, 154, 197, 239), "Home", TabMenu.FontToBitmap(Chr(0xF015), False, 15, xui.Color_White), "")
TabMenu.setTabIcon(0, TabMenu.FontToBitmap(Chr(0xF015), False, 15, xui.Color_White))
Where exactly would you like to add the URL ? Note that using a URL for the text of each tab will make it look a bit ugly on most devices since it will be too long.and how to add an URL for every tab?
sorry i am new in this
no, i mean when i click on home icon for example, i go to home page, and if i click on Categorise, i go to Categorise section on my siteWhere exactly would you like to add the URL ? Note that using a url for the text of each tab will make it look a bit ugly on most devices since it will be too long.
Use the tag property to put a url to a tab, you can set a tag by adding a new tab or at runtime with the property ".setTabTag"and how to add an URL for every tab?
ASTabMenu1.AddTab(xui.Color_ARGB(255,39, 174, 97),"Test",Null,"PutYourURLHere")
On line 230 is the relevant code for this:also how to make the size bigger between icon and text
If isHorizontal = True Then
xlbl_text.SetLayoutAnimated(0,0,xpnl_base.Height/2,xpnl_base.Width,txt_height)
ximg_icon.SetLayoutAnimated(0,xpnl_base.Width/2 - icon_height/2 ,xpnl_base.Height/2 - icon_height/1.5,icon_height,icon_height)
Else
xlbl_text.SetLayoutAnimated(0,0,xpnl_base.Height/2,xpnl_base.Width,txt_height)
ximg_icon.SetLayoutAnimated(0,xpnl_base.Width/2 - icon_height/2 ,xpnl_base.Height/2 - icon_height/1.5,icon_height,icon_height)
End If
Oh i forgot the CurrentIndex property. I have a better code for it because I already have it with me internallygetTabSelected()
use the: "TabSize" propertygetTabCount()
Use this property: "UnderLineHeight"setTabUnderlineSize
i have put my URL but when i click on tab it do nothingUse the tag property to put a url to a tab, you can set a tag by adding a new tab or at runtime with the property ".setTabTag"
The tag is the last parameter in the add tab function:ASTabMenu1.AddTab(xui.Color_ARGB(255,39, 174, 97),"Test",Null,"PutYourURLHere")
ASTabMenu_horizontal.AddTab(xui.Color_ARGB(255,17, 127, 64),"Home",LoadBitmap(File.DirAssets,"Home.png"),"https://www.google.com")
yes, the tag property is a place to store informations for a tab. If you click on a Tab then you can get the tag from the selected tab from the index and put the url into your webview.do i miss anything?
Great, its worked nowYou need to handle it yourself in TabClick event.
If index = 1 Then
WebView1.LoadUrl("https://www.yahoo.com")
End If
If index = 2 Then
WebView1.LoadUrl("https://www.msn.com")
End If
I don't think so. Less so in this version that adds methods and not properties.did i lose all my settings?
you never lose your settings, not even if I add another property to the designer.did i lose all my settings?
this is not planned for this view, because then there would be another dependency on the xcustomlistview.is there a scrollview property?
what do you mean?how to solve ASTabMenu (vertical mode) when there are many .AddTab ;
this is not planned for this view, because then there would be another dependency on the xcustomlistview.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?