TableLayout (TableRow) 내에서 이미지를 가운데 맞추는 데 문제가 있습니다. ImageView는 항상 왼쪽에 있으며 중앙에 그를 필요로합니다.
다음은 XML입니다.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#fff2d8">
<TableLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1">
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/logo"
android:id="@+id/imageView"
/>
</TableRow>
</TableLayout>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="10dp"
android:layout_weight="1">
<TableRow
.
.
레이아웃 이미지가 있습니다 : 스크린 샷
어떻게 할 수 있습니까? 도움을 주셔서 감사합니다.
감사합니다, Petr
다음과 같이 레이아웃을 업데이트하십시오.
<TableLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1" >
<TableRow
android:gravity="center_horizontal|center_vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:id="@+id/imageView"
android:background="@drawable/ic_launcher"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/logo" />
</TableRow>
</TableLayout>
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다