2013-07-04 2 views
0

listview를 작성하는 데 이와 같은 활동을위한 레이아웃이 있지만 listitems에 대한 배경 만 취하고 있습니다 .i 전체 배경을 원합니다.사용자 정의 어댑터를 호출합니다. 사용자 정의 어댑터를 사용할 때 안드로이드에서 전체 화면 배경을 설정하는 방법

<?xml version="1.0" encoding="utf-8"?> 
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@drawable/back" 
    android:padding="5dp" > 

<ImageView 
    android:id="@+id/logo" 
    android:layout_width="50px" 
    android:layout_height="50px" 
    android:layout_marginLeft="5px" 
    android:layout_marginRight="20px" 
    android:layout_marginTop="5px" 
    > 
</ImageView> 

<TextView 
    android:id="@+id/label" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:text="@+id/label" 
    android:textColor="#FFFFFF" 
    android:textSize="30px" > 
</TextView> 

</LinearLayout> 

    setListAdapter(new Categoryarrayadapter(this, c)); 

나는 전체 화면 배경을 설정하는 사용자 정의 카테고리 adapter.How를 호출하고 있습니다.

는 adapter.I의
+0

세트 배경을 다음과 같은 코드를 추가 할 필요가 파악 그래서 쉽게 얻을 수 있습니다 .. –

+0

UI의 listview 객체는 어디에 있습니까? – frogmanx

답변

0

사실 내가 드리고 있습니다 ListActivity 클래스와 내가 설정 한 배경 이미지가 벌어 질 당신이 목록보기를 보유하고있는 레이아웃에에서 onCreate 방법에

getListView().setBackgroundResource(R.drawable.back); 
관련 문제