how to set background image in the listview

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

how to set background image in the listview

Postby nbagade » Mon Dec 28, 2009 10:23 am

I have this layout file
i am displaying imageview and textview in the listview.But while

setting background image ,Listview appear behind the background image.
help me..
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/ihome"
>
<ImageView android:id="@+id/ImageView01"
android:layout_width="48dip"
android:layout_height="48dip">
</ImageView>
<TextView
android:id="@+id/textview01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:paddingRight="4px"
/>
</LinearLayout>
nbagade
Experienced Developer
Experienced Developer
 
Posts: 58
Joined: Fri Nov 20, 2009 7:49 am
Location: India

Top

Postby achie1266 » Mon Dec 28, 2009 6:54 pm

you are setting the background image for each list item in the listView. [I am guessing @drawable/ihome is your background image]. If you want to have it as the background for the whole listView itself then set it as the background for the ListView or the layout in which you placed the ListView.
Please correct me if I am wrong and add more info in case this is not what you want.
achie
User avatar
achie1266
Master Developer
Master Developer
 
Posts: 223
Joined: Mon Nov 09, 2009 10:56 pm
Location: Denver

Postby nbagade » Mon Dec 28, 2009 8:17 pm

I want background for the whole Listview.
nbagade
Experienced Developer
Experienced Developer
 
Posts: 58
Joined: Fri Nov 20, 2009 7:49 am
Location: India

Postby achie1266 » Mon Dec 28, 2009 8:30 pm

what I have said in my earlier post should do it.
If it is not doing it so, can you please also post the layout of the listView and the layout of the listItems as well[if it is different from the one you posted above]
achie
User avatar
achie1266
Master Developer
Master Developer
 
Posts: 223
Joined: Mon Nov 09, 2009 10:56 pm
Location: Denver

Postby nbagade » Tue Dec 29, 2009 6:50 am

Thx,

I set the background for whole ListView ...
It is working fine..
nbagade
Experienced Developer
Experienced Developer
 
Posts: 58
Joined: Fri Nov 20, 2009 7:49 am
Location: India

Postby sabs » Wed Dec 30, 2009 11:13 am

nbagade wrote:Thx,

I set the background for whole ListView ...
It is working fine..


Hi all

I have also set an image as a background for my list view now my problem is iam getting the image for whole screen but i would like to have that image in the center of the screen and also i want to change that image color to light color or dim(tint).

please help me....

with regards
sabs
sabs
Developer
Developer
 
Posts: 32
Joined: Fri Dec 04, 2009 2:55 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 5 guests