2017-02-17 2 views

답변

0

당신은 1) 어떻게 안드로이드이 XML 레이아웃을 그릴 수 2 질문을했다?

당신은 당신이 레이아웃의 중앙 하단에있는 (X) 버튼을 배치하는 방법)

2

붙어 일부 XML 코드와 게시물을 시도해야합니다.

이 경우 부모 레이아웃을 '상대 레이아웃'으로 사용하고 layout_alignParentBottom = true 및 layout_centerHorizontal = true로 (이미지 뷰라고 가정 해 봅시다) 배치하십시오. 아래 코드를 참조 할 수도 있습니다. 위치

위한

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:layout_width="match_parent" 
android:layout_height="match_parent"> 

<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="Testing" 
    android:layout_alignParentBottom="true" 
    android:layout_centerHorizontal="true"/> 

</RelativeLayout> 
1

사용 상대적인 배치는 아니 배경색 (X)의 이미지 버튼을 사용

<ImageButton android:id="@+id/btnid" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:layout_gravity="center_vertical|center_horizontal" 
android:background="@drawable/(X)image"> 
</ImageButton> 
관련 문제