Custom list row in ListView graphical layout

sambay

New Member
There are many many posts and an infinite number of questions on how to create a custom row and add it to a ListView. All the posts I find however, use Java code to set the custom row layout file to the list. Most samples do something like this:\[code\]ArrayAdapter<String> adapter = new ArrayAdapter<String> (this,R.layout.row_layout,R.id.text1,colors);\[/code\]I was wondering if there isn't a way to do this in the XML files directly? Isn't there a property on the ListView where you can set a custom layout file for the rows? The reason I'm asking is because I'm trying to do all (most) of my layout work in the Graphical Layout tool in Eclipse and I would like to be able to preview my layouts in it without launching the app. Surely this should be possible in one way or another? If I could to it in the XML I would be very happy but if I have to write a custom class that will show up in the "custom" part of the graphical layout editor that will do as well.Many thanks for your time.
 
Back
Top