RelativeLayout에서 버튼을 중앙에 출력하려면 어떻게 해야하죠?
조회수 3242회
1 답변
-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ff0000"> <Button android:id="@+id/btn_mybutton" android:layout_height="wrap_content" android:layout_width="124dip" android:layout_marginTop="5dip" android:layout_centerHorizontal="true"/> </RelativeLayout>
이렇게 해보세요. 화면의 정중앙에 오게하고싶으시다면
android:layout_centerVertical="true"
도 주시면 될겁니다.
댓글 입력