사용자 지정 어댑터가있는 목록보기가 있습니다. 항목 아래에 하위 텍스트를 표시하려고합니다. 이것은 내가 사용하고있는 XML이다. 문제는 두 TextView가 병합된다는 것입니다. 내가 무엇을 할 수 있을지?목록보기의 하위 텍스트
0
A
답변
2
이 시도
<?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="wrap_content" >
<ImageView
android:id="@+id/type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ic_launcher" />
<TextView
android:id="@+id/tijd"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:layout_toRightOf="@+id/type"
android:text="abcde" />
<TextView
android:id="@+id/sub"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tijd"
android:layout_toRightOf="@+id/type"
android:text="abcd" />
</RelativeLayout>
그리고 당신의 출력과 같이 될 것입니다, 아래처럼 시도,
1
생각해 보면, 하위에서 centerInParent를 제거해야한다고 생각합니다.
2
사용 레이아웃 아래 서브
<TextView
android:id="@+id/sub"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tijd"
android:centerHorizontal="true"
android:text="abcd" />
0
에 대한 centerhorizontal 수 있습니다
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:id="@+id/type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical" >
<TextView
android:id="@+id/tijd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="title" />
<TextView
android:id="@+id/sub"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="subtitle" />
</LinearLayout>
</LinearLayout>
0
이 시도 :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/tijd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerInParent="true"
android:text="Heading" />
<TextView
android:id="@+id/sub"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tijd"
android:layout_centerInParent="true"
android:text="Subheading" />
<ImageView
android:id="@+id/type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@id/tijd"
android:background="@drawable/ic_launcher" />
0
이
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/type"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/ic_launcher" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:id="@+id/tijd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="adad" />
<TextView
android:id="@+id/sub"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="adad" />
</LinearLayout>
</LinearLayout>
희망하십시오 그것은 효과가있을 것이다.
관련 문제
- 1. 목록보기의 하위 항목에 대한 onclicklistener
- 2. 목록보기의 텍스트 상자
- 3. 목록보기의 텍스트 변경
- 4. 목록보기의 큰 텍스트
- 5. 목록보기의 텍스트 뷰를 만드는 방법
- 6. 안드로이드에서 목록보기의 텍스트 색상을 변경
- 7. 목록보기의 텍스트 대신 이미지 표시
- 8. 목록보기의 단어를 텍스트 상자로 필터링
- 9. 목록보기의 JQuery 모바일/입력 텍스트
- 10. 목록보기의 각 항목에 대한 하위 레코드로드
- 11. Android : 목록보기의 하위 항목을 어떻게 설정합니까?
- 12. 확장 가능한 목록보기의 텍스트 값 늘리기
- 13. WPF 목록보기의 텍스트 상자, 콤보 상자
- 14. 목록 상자/목록보기의 특정 줄에 텍스트 추가
- 15. 회 전자 - 팝업/목록보기의 다른 항목 텍스트
- 16. Android 목록보기의 이미지 및 텍스트 나열
- 17. jquery 목록보기의 모든 텍스트 상자를 선택하십시오.
- 18. 목록보기의 텍스트 필드에서 값을 변경할 수 있습니까
- 19. 목록보기의 backgroundColor
- 20. 목록보기의 그래프
- 21. 목록보기의 EditText?
- 22. 목록보기의 확인란이 선택되었는지 확인해야합니까?
- 23. 어떻게 하위 텍스트를 이미지로 바꾸고 목록보기의 이미지 만 표시합니까?
- 24. 맞춤 목록보기의 링크를 클릭하십시오.
- 25. 목록보기의 Android 동적 아이콘
- 26. Android : 목록보기의 항목 색상 정보
- 27. 사용자 지정 그리기 목록보기의 문제점
- 28. 목록보기의 편집 텍스트에서 포커스 지우기
- 29. 목록보기의 확인란을 선택하면 텍스트 입력 단추가 가운데에서 왼쪽으로 이동합니다.
- 30. 목록보기의 텍스트 편집 기능이있는 Android Search가 제대로 작동하지 않습니다.
어떻게하면 좋을까요? Apoorv가 맞다 ...... – Triode
왼쪽의 이미지가있는 각 행의 중앙에 "tijd"를 넣고 싶습니다. "tijd"아래에 하위 텍스트가 필요합니다. 나는 가이드 라인으로 http://www.vogella.com/articles/AndroidListView/article.html을 사용했다. 챕터 1.3 – Nfear
@Nfear 그림이나 스냅 샷으로 원하는 모양을 보여주십시오 – Raghunandan