Android Question B4XView has not Initialize method

Mike1970

Well-Known Member
Licensed User
Longtime User
hi everyone, today i was coding an app and when a tried to use an B4Xview the app crashed because it was not initliazed, so i tried to do
B4X:
view.Initialize
but the ide says that the method does not exist D:

Thanks
 
Last edited:

Mahares

Expert
Licensed User
Longtime User
Did you add the XUI Views Lib to the lib pane and checked. Example:
B4X:
 Private lbl As Label   'created in designer

In activity Create:
B4X:
Dim b4xlbl As B4XView =lbl
    b4xlbl.Text="test"
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
You can set almost any 'standard' view as a B4XView as shown in post #2.
You can also create a B4XView (equivilant to Panel or Pane) with
B4X:
Private xpnlCursor As B4XView
xpnlCursor = xui.CreatePanel("xpnlCursor")
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
There is a conceptual mistake here. B4XView is a cross platform API that sits above the native controls. There is no initialize method because B4XView must wrap a native view. As Klaus wrote it can be any type of view.
oooooooouuhh okok so this it the intiliaze for the b4xviews
Not at all.
This is just a convenient method to create a Panel (B4A / B4i) or a Pane (B4J). Like any other view it can be assigned to a B4XView.
 
Upvote 0
Top