나는 다음 XML에 있습니다부모 conatiner (안드로이드)에 관한 이미지를 중심에 두는 방법?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_refresh"
android:layout_width="fill_parent"
android:layout_height="110dp"
android:orientation="horizontal"
android:layout_gravity="center_horizontal"
android:visibility="invisible"
android:layout_alignLeft="@+id/layout_status_image"
android:layout_marginTop="5dp"
android:layout_marginLeft="72dp"
>
<!--
android:clickable="true"
android:background="@android:drawable/list_selector_background" -->
<ImageView android:id="@+id/image_refresh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/widget_bt_refresh_idle"
android:layout_gravity="center_horizontal"
android:paddingRight="6dp"
/>
<TextView android:id="@+id/refresh_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:layout_marginTop="25dp"
android:layout_marginLeft="35dp"
android:textColor="@color/solid_white"
android:text="Click to refresh"
/>
</RelativeLayout>
가 어떻게 다음 사항을 해결할 수 있습니까?
1) 본문의 conatiner와 관련하여 refresh image
을 중심에 두십시오.
2)보기
android : centerInParent = "true" – Giant
1. 'android : layout_centerInParent = "true"'또는'android : scaleType = "fitXY"'를 사용하십시오. 2. android : layout_width = "fill_parent"and android : layout_height = "wrap_content"', 이벤트 hough 나는 높이에 관해서 마지막 것에 대해 잘 모르겠다. 'RelativeLayout'의 크기가 고정되어 있다는 것을 명심하십시오. ImageView가 너무 크면'TextView'를위한 공간을 남기지 않을 것입니다. – g00dy
@ g00dy 왜 'android : layout_centerInParent = "true"'가 충분하지 않습니까? 내가 그것을 제거해야합니까? –