[mono-android] Creating a list of TextViews

Paul Johnson paul at all-the-johnsons.co.uk
Wed Feb 29 12:40:52 UTC 2012


Hi,

I have hacked together a calendar which consists of 35 TextViews for
the dates (all called textDatex where x = 1 to 35). I'm trying to read
them into a List<TextView> variable so that I can address them quickly
and set the text simply using a for loop. The problem is getting them
into the List<>. Is there a simple way to do it

Currently, it looks like this

TextView t = FindViewById<TextView>(Resources.Id.textDate1);
tL.Add(t); t = FindView (and so on)

which is a pain for 35 TextViews. Can I enumerate the
Resource.Id.textDate values, pass them into the FindViewById directly?

Thanks

Paul


More information about the Monodroid mailing list