Scrollview, layouts and init values in layout

bluedude

Well-Known Member
Licensed User
Longtime User
Hi,

I really dislike adding UI elements by code. I now know how to get click events from a scrollview that is loaded with a layout but is it possible to set different initial values in every loaded layout in the scrollview?

I think the loaded layout isn't an array so it isn't possible.

Any suggestions?
 

bluedude

Well-Known Member
Licensed User
Longtime User
What I mean is that I load for example the layout 10 times in the scrollview. However, every instance of this layout contains different values for for example a label, text field etc. A little bit like the listview.

So the layout contains interface elements but I want to set these (different button text, image etc.) before viewing in the scrollview. And I don't want to add views by code :)
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I'll answer with an example.
If your layout includes a button named Button1 and you declared a button named Button1 in Sub Globals.
Each time you load a layout file that includes a button named Button1, the variable declared will reference the last "Button1" button.
So you can load a layout file, change Button1 properties and then load the next layout and again modify Button1 properties.
 
Upvote 0
Top