아주 간단한 질문이지만 어떻게해야하는지 모르겠다. 각 행을 표시하는 listview 어댑터와 xml 행이 있습니다. 하나의 행에 3 개의 텍스트 뷰를 표시하려고합니다. 나는 텍스트는 다음과 같이 표시 할여러 줄의 텍스트 뷰
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/txtElement"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="24px"
android:textColor="#000000">
</TextView>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/txtElement2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="24px"
android:textColor="#000000">
</TextView>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/txtElement3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="24px"
android:textColor="#000000">
</TextView>
</LinearLayout>
: 이것은 내 XML 코드
txt1 txt2 txt3
그리고 이것은 내 어댑터 코드입니다 (하지만 난 문제가 XML에 추측) :
TextView tv = (TextView) row.findViewById(R.id.txtElement);
tv.setText(currentElement.getTitle());
TextView tv2 = (TextView) row.findViewById(R.id.txtElement2);
tv2.setText(currentElement.getAuthor());
TextView tv3 = (TextView) row.findViewById(R.id.txtElement3);
tv3.setText(""+currentElement.getNumPost());
미리 감사드립니다.
Ok 바보 같아요. D 감사합니다. – Davis
어떻게 표시하고 싶습니다 : txt1 한 줄에 txt2 txt3 두 번째 줄에 표시하고 싶습니다. – Davis
한 줄에 txt1, 두 번째 줄에 txt2 txt3에 대한 답변을 업데이트했습니다. –