iOS Question TabBar BarButton badge ?

MitchBu

Well-Known Member
Licensed User
Longtime User
I found this discussion (link below) that seems to show a solution to display a badge over a tabbar icon, but it does not seem to apply to the current BarButton I use.

A TabBarItem is mentioned,and I don't see how to apply it.


B4X:
Sub setTabBarSettings
    Dim bb1, bb2, bb3, bb4, bb5 As BarButton
    Dim gride As Bitmap
    gride.Initialize(File.DirAssets, "Data-Grid-icon.png")
    bb1.InitializeBitmap(gride, "Register")
    bb2.InitializeSystem(bb2.ITEM_FLEXIBLE_SPACE, "")
    Dim cheque As Bitmap
    cheque.Initialize(File.DirAssets, "Finance-Check-Book-icon1.png")
    bb3.InitializeBitmap(cheque, "Check")
    Dim help As Bitmap
    help.Initialize(File.DirAssets, "Very-Basic-About-icon.png")
    bb4.InitializeSystem(bb2.ITEM_FLEXIBLE_SPACE, "")
    bb5.InitializeBitmap(help, "Help")
    Page1.ToolbarButtons = Array(bb1, bb2, bb3, bb4, bb5)
End Sub
 

Semen Matusovskiy

Well-Known Member
Licensed User
BarButton is not a view, but has a property view
Having a view, it's possible to add label ('barge') as subview in right top corner.

To find a view after Page1.ToolbarButtons = ..., it's neccessary to wait a little.
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
For example, after Page1.ToolbarButtons = ...
B4X:
    Dim no, Tmp, Dummy As NativeObject
    no = bb1  ' Barbutton
    Tmp = Dummy
    Do While Tmp = Dummy
        Tmp = no.GetField ("view")
        Sleep (1)
    Loop
    Dim     v1 As View    = Tmp

Spaces do not have views. So you can search the views for bb1 bb3 bb5 only
 
Last edited:
Upvote 0
Top