Question

I have a lot of views. And I like to have them placed in the program, taking the size of the screen in account. But I have a problem accessing the views in a loop.

Now, I have to take one view at the time:

view1.top = xdip
view2.top = xdip

What I really want to do is:

for c = 1 to 40
    view(c).top = ...
next

But I can't get it to work. Can anyone enlighten me?

Was it helpful?

Solution

See this tutorial.

Here is an example:

For i = 0 To Activity.NumberOfViews - 1
    Dim v As View
    v = Activity.GetView(i)
    v.Top = 30dip
Next
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top