Android Question Which properties are exposed by B4XView?

Tom_707

Member
Licensed User
Is there documentation which lists the Views that B4XView wraps, and which properties of those Views it exposes?

I am unable to access the Spinner.SelectedItem property via a B4xView, as in the following example:
B4X:
Dim bxvItem As B4XView

bxvItem = pnlPanel     'pnlPanel contains a Spinner View in index position 0
Log(bxvItem.GetView(0).SelectedItem)
So am I correct in assuming that a B4XView accesses some Views and their properties, but not all Views? So the above code won't work because a B4XView does not expose/ allow access to a Spinner view's properties?
 

Erel

Administrator
Staff member
Licensed User
Tip: use B4XComboBox (XUI Views library) instead of spinner. It is the cross platform version of spinner.

The build in help, which is also available here: https://www.b4x.com/android/help/xui.html#b4xview, lists the supported native views for each method.

The most important concept behind B4XView is that you can always cast it back to the native view and access the platform specific methods.
 

Tom_707

Member
Licensed User
Yes, casting the B4XView back to the original View did the trick! It gave me access to all of the original View's properties. Thanks Erel!

(I'll also change the Spinner View to a B4XComboBox. Thanks.)
 
Top