Android Question Toolbar title center text

Emme Developer

Well-Known Member
Licensed User
Longtime User
Hi to all!
Is possible to center title in ACToolBarDark?

I tried these ways but without luck.
B4X:
'Code 1
    Dim align As JavaObject
    align.InitializeStatic("android.support.v7.widget.Toolbar")
    Log(align.GetField("TEXT_ALIGNMENT_CENTER"))
    
    Dim jo As JavaObject = Toolbar
    jo.RunMethod("setTextAlignment",Array(align.GetField("TEXT_ALIGNMENT_CENTER")))


'Code 2
Dim cs As CSBuilder
    cs.initialize.Alignment("ALIGN_CENTER").Append(title).PopAll
    Toolbar.Title = cs

Many thanks
 
Top