GridLayout 및 textviews를 사용하여 세부 정보보기를 만들고 있습니다. 내 GridLayout에는 약 6 개의 행과 2 개의 열이 있습니다. 첫 번째 행에는 두 개의 텍스트 뷰가 있습니다. 첫 번째 (현수막)에는 텍스트를 중심으로 배치하는 배경 이미지가 있습니다. 내 이미지의 너비는 약 150 픽셀입니다. 두 번째 textview (자료)는 한 단어에서 20 단어까지 모두 가질 수 있습니다. 텍스트를 줄 바꿈하고 싶습니다 (최대 5 줄).TextView 너비 혼란
제 문제는 두 번째 textview (재료)의 텍스트가 화면에서 사라지는 것입니다. 나는 성공하지 않고 조정할 너비를 얻으려고 여러 가지 설정을 시도했다. 다음은 XML 레이아웃입니다.
<?xml version="1.0" encoding="UTF-8"?>
<android.support.v7.widget.GridLayout
xmlns:grid="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alignmentMode="alignBounds"
android:background="@color/lemon"
grid:columnCount="2"
grid:rowCount="6" >
<TextView
android:id="@+id/placard"
grid:layout_gravity="right"
grid:layout_column="0"
grid:layout_row="0"
android:padding="5sp"
android:gravity="center"
android:textColor="#000000"
android:textSize="24sp"
android:textStyle="bold" />
<TextView
android:id="@+id/material"
grid:layout_column="1"
grid:layout_row="0"
android:layout_gravity="center"
android:layout_width="fill_parent"
android:ellipsize="none"
android:scrollHorizontally="false"
android:padding="5sp"
android:singleLine="false"
android:maxLines="5"
android:textColor="#0000ff"
android:textSize="12sp"
android:textStyle="bold" />
</android.support.v7.widget.GridLayout>
제안 사항을 보내주십시오. 고맙습니다.
어떻게 6 개 행을 정의하지만 1 요소를 정의하는 온? – Justin
추가 행에 시간과 노력을 투입하기 전에 첫 번째 행에서 문제를 해결하고 싶습니다. – wyoskibum