Hi everyone,
I'm trying to put a BarButton in right of the navbar with an image...
i used the function found here and here.
But the image goes always in the center
(actually is like the image is large as all the navbar)
the code is
And the result is
The same if i do it from the Designer.
Thanks in advance
I'm trying to put a BarButton in right of the navbar with an image...
i used the function found here and here.
But the image goes always in the center
(actually is like the image is large as all the navbar)
the code is
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
B4XPages.GetNativeParent(Me).TopRightButtons = Array(CreateFABarImg("profile.png", "profile"))
End Sub
Private Sub CreateFABarImg(sFile As String, tag As Object) As BarButton
Dim bb As BarButton
Dim b As ImageView
b.Initialize("img")
b.Color = Colors.red
b.ContentMode = b.MODE_FIT
b.Bitmap=LoadBitmap(File.DirAssets,sFile)
b.Tag = tag
bb.InitializeCustom(b)
Return bb
End Sub
And the result is
The same if i do it from the Designer.
Thanks in advance