J Jost aus Soest Active Member Licensed User Longtime User Mar 12, 2012 #1 I need to change the title of the current tab, e. g. something like Code: Copy Sub txtBez_TextChanged(Old As String, New As String) Dim TabCaption As String If New.Trim = "" Then TabCaption = "Spieler " & MainTab.CurrentTab Else TabCaption = New.Trim End If MainTab.Title(MainTab.CurrentTab) = TabCaption End Sub so it can reflect in real time, what I'm typing in an EditText. How is this possible? I've already checked the TabHostExtras-Library, but without results. Last edited: Mar 12, 2012
I need to change the title of the current tab, e. g. something like Code: Copy Sub txtBez_TextChanged(Old As String, New As String) Dim TabCaption As String If New.Trim = "" Then TabCaption = "Spieler " & MainTab.CurrentTab Else TabCaption = New.Trim End If MainTab.Title(MainTab.CurrentTab) = TabCaption End Sub so it can reflect in real time, what I'm typing in an EditText. How is this possible? I've already checked the TabHostExtras-Library, but without results.
Erel B4X founder Staff member Licensed User Longtime User Mar 13, 2012 #2 It is not possible in TabHost. Not sure about TabHostExtras. Upvote 0
J Jost aus Soest Active Member Licensed User Longtime User Mar 13, 2012 #3 Alternatives? How can i change the tabs of a tabhost, when there is also no RemoveTab method? Will it be possible in the (near) future? Or how would you accomplish now the following task: I'm developing a digital score card (for calculating the victory points of a board game, but this doesn't matters), where every tab shall represent one player (and tab 0 the summary). After game end it's necessary to change the player names befor beginning a new game. Upvote 0
Alternatives? How can i change the tabs of a tabhost, when there is also no RemoveTab method? Will it be possible in the (near) future? Or how would you accomplish now the following task: I'm developing a digital score card (for calculating the victory points of a board game, but this doesn't matters), where every tab shall represent one player (and tab 0 the summary). After game end it's necessary to change the player names befor beginning a new game.
warwound Expert Licensed User Longtime User Mar 13, 2012 #4 I think it'd be easiest to remove the existing TabHost and create then add a new TabHost for each new game. I'll try and make time to look into whether the TabIndicator text can be changed and post again with my findings. Martin. Upvote 0
I think it'd be easiest to remove the existing TabHost and create then add a new TabHost for each new game. I'll try and make time to look into whether the TabIndicator text can be changed and post again with my findings. Martin.
J Jost aus Soest Active Member Licensed User Longtime User Mar 13, 2012 #5 Thank you Martin! warwound said: I think it'd be easiest to remove the existing TabHost and create then add a new TabHost for each new game. Click to expand... I've feared such an answer... What's the easiest way to accomplish this? warwound said: I'll try and make time to look into whether the TabIndicator text can be changed and post again with my findings. Click to expand... That would be great!:icon_clap: Upvote 0
Thank you Martin! warwound said: I think it'd be easiest to remove the existing TabHost and create then add a new TabHost for each new game. Click to expand... I've feared such an answer... What's the easiest way to accomplish this? warwound said: I'll try and make time to look into whether the TabIndicator text can be changed and post again with my findings. Click to expand... That would be great!:icon_clap:
warwound Expert Licensed User Longtime User Mar 13, 2012 #6 Jost aus Soest said: What's the easiest way to accomplish this? Click to expand... Are you using the Designer to add a TabHost to your Activity, then programmatically adding TabContent? If so then the logical way would i think to create and add your TabHost entirely in code - programmatically. You'd need to write code (on top of what you already have written) to Initialize the TabHost before using Activity.AddView to add it to your Activity. A TabHost has a RemoveView method that you can use to remove it from your Activity. Once you have removed it just re-use your existing code and start again: Initialize and add a new TabHost to your Activity. Add the TabContent. Tweak it with TabHostExtras. Finally remove it when it's finished with. I've updated TabHostExtras to version 1.6 adding a new method to enable you to set the text of individual tabs: http://www.b4x.com/forum/additional-libraries-official-updates/11056-tabhostextras.html#post61757 Martin. Upvote 0
Jost aus Soest said: What's the easiest way to accomplish this? Click to expand... Are you using the Designer to add a TabHost to your Activity, then programmatically adding TabContent? If so then the logical way would i think to create and add your TabHost entirely in code - programmatically. You'd need to write code (on top of what you already have written) to Initialize the TabHost before using Activity.AddView to add it to your Activity. A TabHost has a RemoveView method that you can use to remove it from your Activity. Once you have removed it just re-use your existing code and start again: Initialize and add a new TabHost to your Activity. Add the TabContent. Tweak it with TabHostExtras. Finally remove it when it's finished with. I've updated TabHostExtras to version 1.6 adding a new method to enable you to set the text of individual tabs: http://www.b4x.com/forum/additional-libraries-official-updates/11056-tabhostextras.html#post61757 Martin.
J Jost aus Soest Active Member Licensed User Longtime User Mar 13, 2012 #7 Thank you very much! I've thought that TabHost.RemoveView is for removing a TabHost-child (i. e. a tab-content). :BangHead: Now this is much clearer! But with your new version of TabHostExtras my wishes came already true! Together with setTabVisibility2 I'm now able to configure (and change in run time!) the tabs like I want. :sign0098: Upvote 0
Thank you very much! I've thought that TabHost.RemoveView is for removing a TabHost-child (i. e. a tab-content). :BangHead: Now this is much clearer! But with your new version of TabHostExtras my wishes came already true! Together with setTabVisibility2 I'm now able to configure (and change in run time!) the tabs like I want. :sign0098: