다음 지침을 따르고 있습니다. http://saigeethamn.blogspot.com/2010/04/custom-listview-android-developer.html이 목록/스크롤 뷰가 부모를 채우지 않는 이유는 무엇입니까?
다음 예에서는 목록 전체 화면을 보여줍니다. 그게 내가 원하는거야. 내가 도대체 뭘 잘못하고있는 겁니까?
로서는 결과 :
내 결과 : I는 다음
예시 2 XML 레이아웃을 사용한다. 1 페이지. 1 목록.
페이지 : 여기
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ListView android:id="@id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000fff"
android:layout_weight="2"
android:drawSelectorOnTop="false">
</ListView>
<TextView android:id="@id/android:empty"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFff00"
android:text="No data"
/>
</LinearLayout>
</ScrollView>
그리고는 목록에 대한 XML의 :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TextView android:id="@+id/tvAccountName"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="#FFFF00"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
<TextView android:id="@+id/tvAccountType"
android:typeface="sans"
android:textSize="14sp"
android:textStyle="italic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/tvAccountBalance"
android:textSize="12sp"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="fill_parent"/>
</LinearLayout>
그리고 여기 매니페스트에서 항목입니다 :
<activity android:name=".listAccountsPage"
android:label="@string/app_name"
>
<intent-filter>
<action android:name="com.ourcreditunion.ourcumobile.LISTACCOUNTS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
그래서 내가 무엇을 했는가 전체 화면이 아니게 만드시겠습니까?
의 배경 속성을 설정합니다. 그러지 마. :) – adamp