Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Make Group of XML For Every n Items in List

$
0
0

Okay, I've had a fair chunk of experience with classic C#, but I literally picked xamarin android up 26 hours ago so I'm still very green to this and XML in general. I've got a TableLayout currently, the idea was to have headings which would have records underneath containing different entries e.g. NAME AGE LOCATION -- first entry: David 24 London, under that another entry: Susan 29 Kentucky.

The data is saved into a personal folder for the app on the device (this app is only going to really be used by me and close associates so there's no need for it to be perfectly data-secure, it's not even containing any real info about any real people). I'm getting this from a txt file and reading in the data into string arrays, which I then use the elements of arrays to display the data into the table (It works for 1 entry), but like this, I'm simply doing a 'SetText' to change the text of TextView, this means I can only have 1 record, I would obviously like more than 1 record.

So, the main question - how can I get something like

    <TableRow
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    <TextView
        android:text=""
        android:id="@+id/txtDisplayName"/>
    <TextView
        android:text=""
        android:id="@+id/txtDisplayRace"/>
    <TextView
        android:text=""
        android:id="@+id/txtS" />
    <TextView
        android:text=""
        android:id="@+id/txtP" />
    <TextView
        android:text=""
        android:id="@+id/txtE" />
    <TextView
        android:text=""
        android:id="@+id/txtC" />
    <TextView
        android:text=""
        android:id="@+id/txtI" />
    <TextView
        android:text=""
        android:id="@+id/txtA" />
    <TextView
        android:text=""
        android:id="@+id/txtL" />
</TableRow>

(Sorry I don't know how to format it here, on stack overflow it's 4 spaces) to be generated for every record?

Thanks for any help :) I appreciate it.

Edit: Just to add, even if it's just a name of a technique or article I can read I'll be grateful :)


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>