Android Question [SOLVED] It is possible to create and show how to update or add menu items at runtime to a TabStrip

desof

Well-Known Member
Licensed User
Longtime User
https://www.b4x.com/android/forum/threads/appcompat-with-toolbar-minimal-example.79896/#post-509530
I was looking at this example and I wanted to know if it would be possible to create something like that but in a TabStrip?
as it shows the image that I have created to illustrate the need



H2848M2.png

Hello Erel, would it be possible to implement the update of the icon in a TabStrip that loads in this way?

TabStrip1.LoadLayout ("Page4", "" & "" & "") 'Notices
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
SS-2018-01-09_18.40.29.png


1. You need to use CSBuilder to put an image in the tab labels.
2. Update the label with:
B4X:
Dim lbl As Label = GetAllTabLabels(TabStrip1).Get(1) '1 = tab #2
Dim cs As CSBuilder
lbl.Text = cs.Initialize.Image(AddBadgeToIcon(cart, 5), cart.Width, cart.Height, False).PopAll
cart is a global bitmap.
 
Upvote 0
Top