I’m trying to show two different views in each element of the list. Both vews are text views, but I want one of them to be enclosed in a square with a different color. I know is possible because I’ve read about it but I’m not able to understand it properly!
Any ideas?
Thanks!
You can create your own adapter for the list. The adapter is what decides how to display the items in the list.
Here is an example:
And you also need the line-layout to contain all the elements you need (this is what will be displayed on each line of the list), let’s call it ‘thelinelayoutfile.xml’ and put it in the layout folder:
Then when you initialize your list (in your
onCreate()method, perhaps?)You call