I've been struggling with this code for quite sometime in order to make it cross-platform compatible.
b4j label as shown in B4XPagesCrossPlatformProjectsV2_1.pdf documentation is as follows:
HERE all labels are shown to be compatible across platforms
but in actual there are some properties not available in others (like label.setbackground in b4a is not available in b4j)
after having gone back and forth trying to replace label with some other view and finding out that something else is not available in that view,
it brings me here to ask more experience developers on
1. Is there a comprehensive list of what properties / functions/ methods are available and not available across platforms?
2. Is there a quick guide OR reference OR tool to help convert code to other platforms which can help me ? if not, then, is hit an trial the only way to navigate forward?
b4j label as shown in B4XPagesCrossPlatformProjectsV2_1.pdf documentation is as follows:
HERE all labels are shown to be compatible across platforms
but in actual there are some properties not available in others (like label.setbackground in b4a is not available in b4j)
after having gone back and forth trying to replace label with some other view and finding out that something else is not available in that view,
it brings me here to ask more experience developers on
1. Is there a comprehensive list of what properties / functions/ methods are available and not available across platforms?
2. Is there a quick guide OR reference OR tool to help convert code to other platforms which can help me ? if not, then, is hit an trial the only way to navigate forward?
B4X:
'called by
label1.SetBackgroundImage(FontAwesomeToBitmap(chrt,40))
Sub FontAwesomeToBitmap (Text As String, FontSize As Float) As B4XBitmap
Dim xui As XUI
Dim p As Panel = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, 32dip, 32dip)
Dim cvs1 As B4XCanvas
cvs1.Initialize(p)
Dim fnt As B4XFont = xui.CreateFontAwesome(FontSize)
Dim r As B4XRect = cvs1.MeasureText(Text, fnt)
Dim BaseLine As Int = cvs1.TargetRect.CenterY - r.Height / 2 - r.Top
cvs1.DrawText(Text, cvs1.TargetRect.CenterX, BaseLine, fnt, PressedColor, "CENTER")
Dim b As B4XBitmap = cvs1.CreateBitmap
cvs1.Release
Return b
End Sub