sequencing thru views in a layout to enable/disable

pcbtmr

Member
Licensed User
Longtime User
how?
I need to sequence thru a number of views in a layout to disable them temporarily. Something like this:
for i=1 to Layout.Views(i)
if View(i) is a button or edittext then view(i).disable
next

Much appreciated!
 

pcbtmr

Member
Licensed User
Longtime User
Hate to say it but didn't work. I have a layout (CalcLayout)of 4 buttons and 4 edit texts but the log(activity.NumberOfViews) returns 1. The main layout has only the single tabhost that loads the 3 layouts. What am I missing?

Thanks.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
This code only handles views that added directly to the Activity.
In the case of TabHost it is a bit more complicated. You should add the tabs by calling AddTab2 and add a panel as the parent layout. Call Panel.LoadLayout to load the layout files.

You should then iterate over the three panel views in a code that is similar to the code I posted before.
 
Upvote 0

pcbtmr

Member
Licensed User
Longtime User
Got it. Thanks for the response. I think for the headache envisioned, I will explicitly call out the buttons and edit texts and disable/enable. While not elligant (sp), it's only 4 items of each.
 
Upvote 0
Top