[mono-android] Using ListView to dynamically create a table & design Q

Paul Johnson paul at all-the-johnsons.co.uk
Wed Feb 15 08:01:32 UTC 2012


Hi,

I'm trying to use as few views as possible for a particular application 
and was thinking of using ListView to create a table when the view and a 
pageID are presented.

The setup for the generic page is this (each line represents a screen 
line, [] represents a non-widget view)

[TabHost]
[RelativeView]
image (advert)
image (back) / textview
[Table]
[TableRow]
textview / image
[TableRow]
(etc)
[LinearLayout]
[Tab]
[FrameView]
Tab/Tab/Tab/Tab

Rather than have that, is it possible to dynamically create the rows 
depending on the number of items in the ListView?

So it would become

[TabHost]
[RelativeView]
image (advert)
image (back) / textview
[Table]
foreach(string l in ListView)
{
    [TableRow]
    text / image (+ event for image)
}
[LinearLayout]
[Tab]
[FrameView]
Tab/Tab/Tab/Tab

As the top 4 lines and bottom 4 lines are always the same, is it 
possible to use fragments so that in effect all I have is

fragment_top
foreach
fragment_bottom

or is that overkill and would slow down the app?

Target is Android 2.2

TIA

Paul


More information about the Monodroid mailing list