I am currently developing custom view to be shared by Android and IOS. I started the programming of custom view in android and tried to bring the
same custom view (XXX.B4xlib) to IOS Library. I found some of the components (Edittext - in B4A) are not present in B4i (B4i using Textfield). Hence an error pops up when i try to run in IOS.
Are all these components supported by both Android and IOS? (At least Edittext (from android) is not supported by IOS.
What is the best replacement for Edittext (Android) that can be supported by both? Or is there an indication which component are supported / which are not?
Thank you all for your quick response on this. I have been using B4A for quite few years and are seriously looking into XUI instead off normal components as mentioned above that XUI view are cross platform. After playing it for few hours, i got really excited as all XUI views are built base on customview from erel's team.
I was just wondering why there is no panel as usual - What are the replacement?
Or is it that i can still use the conventional panel from B4A (In which exists in B4i) ? - Or is it CustomListView?
Missing of XUI view label as well. --> Replacement XUIview --> Scrolling label?
QUESTIONS :
1) Where do i find setting as image above in my IDE?
2) By right clicking an object (For example button, I know that i can generate 'Dim Button1 as B4xView')..and that is on the Designer. What about if i am to generate a button by code?
B4X:
Dim MynewButton as B4xView
MynewButton.Initialize <---- ERROR (No initialize)
Panel1.Addview(MynewButton,0,0,100,100)
*** Run with error as MynewButton not initialized
3) Dim MynewButton as B4xView <<-- how actually it knows its a button? or a label or etc..?
2) By right clicking an object (For example button, I know that i can generate 'Dim Button1 as B4xView')..and that is on the Designer. What about if i am to generate a button by code?
By code, you need to create before the "native View":
B4X:
Dim btnMynewButton As Button
Dim xMynewButton As B4XView
btnMynewButton.Initialize("EventName")
Panel1.Addview(btnMynewButton,0,0,100,100)
xMynewButton = btnMynewButton
but I strongly advise you not to create any type of View by code and to always use the Designer.
Thanks for your prompt reply. I know that components that we put in the designer form is easy and can be cast to B4XView (It will know that it is a button / label etc)
What about if i am to create a button via code?
Example :
B4X:
Dim sButton as B4XView
sButton.initialize("sButton") <--- No such function
Panel1.Addview(sButton,0,0,100,100)
*Above gives me error saying sButton is not initialized. How can i initialise it?
and how did B4A knows that sButton is a button? (As it is set to B4xView)
I am having trouble creating a button (B4xView) by code
Thanks for your prompt reply. I know that components that we put in the designer form is easy and can be cast to B4XView (It will know that it is a button / label etc)
What about if i am to create a button via code?
Example :
B4X:
Dim sButton as B4XView
sButton.initialize("sButton") <--- No such function
Panel1.Addview(sButton,0,0,100,100)
*Above gives me error saying sButton is not initialized. How can i initialise it?
and how did B4A knows that sButton is a button? (As it is set to B4xView)
I am having trouble creating a button (B4xView) by code
Dim sButton As Button
sButton.initialize("sButton")
Root.Addview(sButton,0,0,100dip,100dip) 'you can use your panel for parent instead of root
Dim xButton As B4XView =sButton
xButton.SetColorAndBorder(xui.Color_Red, 6dip,xui.Color_Cyan,10dip)
Means button are actually wrapped by B4xView in which are supported by multiplatform. OK Got it!
In other words, B4xView is like a styler or CSS like which supported by multiplatform... instead of using the button properties which ,might not
be the same in IOS.