iOS Question BarButton Icon

Emme Developer

Well-Known Member
Licensed User
Longtime User
Hi to all! I'm trying to add an info icon, but i have some issue.

B4X:
    Dim bb As BarButton
    bb.InitializeBitmap(LoadBitmap(File.DirAssets,"[email protected]"),"1")
    bb.Enabled = True
    bb.TintColor = 0xFFED7B53
    mpa.TopRightButtons = Array As Object(bb)

icon is 25 x 25 and this is result


upload_2017-7-25_16-23-33.png


Icon is not centered

B4X:
Dim bb As BarButton
    bb.InitializeText(Chr(0xE88F),1)
    bb.Enabled = True
    bb.TintColor = 0xFFED7B53
    bb.SetFont(Font.CreateMaterialIcons(32))
    mpa.TopRightButtons = Array As Object(bb)

upload_2017-7-25_16-25-2.png
 

Emme Developer

Well-Known Member
Licensed User
Longtime User
Why aren't you adding the BarButton with the designer?

If I remember correctly the icon size should be 24 * 24.

You can use CSBuilder.VerticalAlign to fix the alignment.
Thanks Erel, i tried to add it using Designer, but i don't achieve what i want. But after follow your tutorial, i achieve right dimensions on icon using InitializeCustom and using a button
 
Upvote 0
Top