텍스트 뷰에 텍스트가 올바르게 표시되지 않습니다. 텍스트는 두 행에 걸쳐 있지만 두 번째 텍스트 행은 텍스트의 상반부 만 표시합니다. 마치 height = wrap_content
을 사용 했음에도 불구하고 텍스트가 수평으로 2 개로 절단 된 것처럼 보입니다.테이블 레이아웃에 TextView가 올바르게 표시되지 않습니다.
XML 코드 :이 해결
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="15dp"
android:weightSum="1" >
<TextView
android:id="@+id/textView1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.4"
android:text="No. of direct Reportees:" />
<EditText
android:id="@+id/direct"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.6"
android:hint="Eg. 12"
android:inputType="numberDecimal"
android:textAppearance="?android:attr/textAppearanceSmall" >
<requestFocus />
</EditText>
</TableRow>
는 :
이 동작은 기본 정렬 예정이다. 컨테이너의 높이가 정확합니다 (두 개의 자식 중 최대 크기). Textview
은 단추와 일치하는 기준선이되도록 아래로 이동합니다. 이 동작은 기존 앱의 레이아웃을 유지하기 위해 변경할 수 없습니다. 귀하의 경우이 레이아웃을 구현하는 올바른 방법은 LinearLayout
태그에 android:baselineAligned="false"
을 추가하는 것입니다. 그러면 TextView
위의 추가 수직 공간도 제거됩니다.
오류 발생 : 의심스러운 크기 :보기를 보이지 않게합니다. 아마도 layout_height – Jimmy
에 대한 것이므로 wrap_content 내에서 match_parent를 가져서는 안됩니다. 동시에 나는 테이블 행에서도 체중이 작동한다고 생각합니다. –
무게가 더 일찍 잘 작동했다. – Jimmy