我做了一個自定義adapter
listview
但它不工作,兩個textview
覆蓋當我建立,但它工作時,我做的xml,我用layout_below
。
layout_below在自定義適配器在列表視圖
我xml
代碼:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView_stud_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:paddingLeft="8dp"
android:textSize="18sp"
android:textStyle="bold"
android:text="111"/>
<TextView
android:id="@+id/textView_stud_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_below="@+id/textView_stud_name"
android:paddingLeft="8dp"
android:textSize="12sp"
android:text="111"/>
<Button
android:id="@+id/btn_absence"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:background="@color/red"
android:text="Absence" />
<Button
android:id="@+id/btn_check"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/btn_absence"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:background="@color/green"
android:text="Check" />
</RelativeLayout>
如何解決這個問題?感謝您的迴應。
感謝您的幫助,但如果我想繼續我的第一種方式,該如何解決? –
你必須保持太多的觀點關係......就像這個觀點在這個觀點左邊,這個觀點正好在這個下面,在這個......之上......更忙碌而沒有維護他的形狀 –