我有兩個叫compliance_details.xml
和compliance_details_row.xml
Textviews沒有在屏幕
以下XML文件佔據特定的空間,是我compliance_details.xml代碼
<?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:orientation="vertical">
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="10dp"
android:layout_marginTop="15dp">
<TextView
android:id="@+id/taskNameLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_marginRight="70dp"
android:layout_weight="3"
android:singleLine="true"
android:text="TaskName"
android:textColor="#000"
android:textSize="20sp" />
<TextView
android:id="@+id/dueDateLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_marginRight="20dp"
android:layout_weight="1"
android:singleLine="true"
android:text="Due Date"
android:textColor="#000"
android:textSize="20sp" />
<TextView
android:id="@+id/ageingLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_marginRight="20dp"
android:layout_weight="1"
android:singleLine="true"
android:text="Ageiging"
android:textColor="#000"
android:textSize="20sp" />
</TableRow>
</TableLayout>
<ListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"
android:paddingTop="10dp" />
</LinearLayout>
and following is my compliance_details_row.xml code
<?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">
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="10dp"
android:layout_marginTop="15dp">
<TextView
android:id="@+id/taskNameValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_marginRight="70dp"
android:layout_weight="3"
android:singleLine="true"
android:text="TaskName"
android:textColor="#000"
android:textSize="20sp" />
<TextView
android:id="@+id/dueDateValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_marginRight="20dp"
android:layout_weight="1"
android:singleLine="true"
android:text="Due Date"
android:textColor="#000"
android:textSize="20sp" />
<TextView
android:id="@+id/ageingValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_marginRight="20dp"
android:layout_weight="1"
android:singleLine="true"
android:text="Ageiging"
android:textColor="#000"
android:textSize="20sp" />
</TableRow>
</TableLayout>
</LinearLayout>
在我的適配器,林充氣具有compliance_row.xml的compliance_details_row.xml。
但是,當我這樣做時,compliance_details_row的元素有點失真。
從上圖可以看出,符合性名稱應該在標題TaskName
之下,但符合性名稱有點失真,並且截止日期值也只是部分可見。我怎樣才能解決這個問題?