My interface is very dynamic and I pretend to know how to use XUI controls without using the designer, just adding to the activity the controls.
It is possible?
Not for many (if any) of them. Just create a designer view with only the control (remove the Autoscale All command) and load the layout with the control you need.
If you need a reference to the control you can use code such as
B4X:
ParentContainer.LoadLayout("viewlayout.bal")
Dim NewXUICtrl as B4XView = ParentContainer.Getview(0)
' or if this is one of many controls then "ParentContainer.GetView(ParentContainer.NumberOfViews - 1)
@Erel has an example of this somewhere on the forum but I can't find it at the moment.
Custom views are designed to be added with the designer. It is however very simple to create a layout file with the custom view and load it multiple times. Tip: remove the call to AutoScaleAll from the designer script. Complete example: Sub Globals Private B4XSwitch1 As B4XSwitch End...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.