Created
October 26, 2017 12:35
-
-
Save davidortinau/a832487daef2378fdb8870bb3efe61db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Android.Views; | |
public int Count = 0; | |
public void Iterate(View view) { | |
if (view is ViewGroup) | |
IterateViewChildren(view); | |
System.Console.WriteLine($"Total Children {Count}"); | |
} | |
private void IterateViewChildren(View view) { | |
if (view is ViewGroup) { | |
ViewGroup vGroup = (ViewGroup)view; | |
for (int i = 0; i < vGroup.ChildCount; i++) { | |
View vChild = vGroup.GetChildAt(i); | |
IterateViewChildren(vChild); | |
} | |
} | |
Count++; | |
} | |
Iterate(selectedView); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment