Reputation: 67
This is the .xml of the MainActivity, It's composed by two tabhost, the first contain a dynamic listview. I want to add in the beginning of every item of listview an image like an icon or logo.
What are modifications of the .xml that i must do. thx
this is main.xml
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp"/>
</LinearLayout>
</TabHost>
Upvotes: 0
Views: 346
Reputation: 1687
You can find a tutorial of using Custom ArrayAdapter with ListView: http://www.ezzylearning.com/tutorial.aspx?tid=1763429.
Here is another tutorial http://www.vogella.com/articles/AndroidListView/article.html.
Hope this helps.
Upvotes: 1
Reputation: 14089
You need to set up an adapter for your ListView
and then in the getView
of the adapter inflate or programmatically create a group of views that represents each individual item in the ListView
.
You should google tutorials about how to set up adapters for ListView
s
Upvotes: 0