Emme Developer Well-Known Member Licensed User Longtime User Jul 25, 2017 #1 Hi to all! I'm trying to add an info icon, but i have some issue. Spoiler: First Try B4X: Dim bb As BarButton bb.InitializeBitmap(LoadBitmap(File.DirAssets,"ios_info@1x.png"),"1") bb.Enabled = True bb.TintColor = 0xFFED7B53 mpa.TopRightButtons = Array As Object(bb) icon is 25 x 25 and this is result Spoiler: Second try 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)
Hi to all! I'm trying to add an info icon, but i have some issue. Spoiler: First Try B4X: Dim bb As BarButton bb.InitializeBitmap(LoadBitmap(File.DirAssets,"ios_info@1x.png"),"1") bb.Enabled = True bb.TintColor = 0xFFED7B53 mpa.TopRightButtons = Array As Object(bb) icon is 25 x 25 and this is result Spoiler: Second try 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)
Erel B4X founder Staff member Licensed User Longtime User Jul 26, 2017 #2 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. Upvote 0
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.
Emme Developer Well-Known Member Licensed User Longtime User Jul 26, 2017 #3 Erel said: 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. Click to expand... 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
Erel said: 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. Click to expand... 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