Android Question How to get number of views in Panel?

b4auser1

Well-Known Member
Licensed User
Longtime User
I want to buld code like
For i = 0 To Panel.Size
Panel.GetView(i)
...

but I didn't find a method Size to get number of child views in Panel

GetAllViewsRecursive returns all the child views including views that were added to other child views, but I need the views that were added to the Panel directly
 

b4auser1

Well-Known Member
Licensed User
Longtime User
NumberOfViews returns all the child views including views that were added to other child views ? Or just the views that were added to the Panel directly ?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
NumberOfViews returns only the views added to the given View (Activity or Panel).
If in Panel1 you add 5 Panels (Panel11, Panel12, Panel13, Panel14, Panel15) each one having 3 views inside, Panel1.NumberOfViews returns 5, because it has 5 child views.
But each child view of Panel1 has 3 child views of its own !
So Planel11.NumberOfViews = 3, same for the others.
 
Upvote 0
Top