2012-04-28 6 views
0

나는 활동을하고 난이 안드로이드 대화 상자 닫기 버튼

<activity android:name=".ChangeUserImageActivity" android:theme="@android:style/Theme.Dialog"></activity> 

가 어떻게 오른쪽 상단에 닫기 버튼을 만들 수 있습니다 사용하여 대화로 설정 한?

<Button 
    android:id="@+id/closebtn" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentRight="true" 
    android:layout_alignParentTop="true" 
    android:text="X" 
    android:textSize="18sp" 
    android:onClick="close_click" 
    /> 

그리고 다음 나는 절대 레이아웃을 사용하고 있습니다로 현재 내 레이아웃은

<Button 
    android:id="@+id/closebtn" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_x="260px" 
    android:layout_y="5px" 
    android:text="X" 
    android:textSize="18sp" 
    android:onClick="close_click" 
    /> 
+1

여기에 레이아웃 xml을 표시 할 수 있습니까? – NrNazifi

답변

3

은 부모가 다음 RelativeLayout하고 Button은 다음과 같이됩니다 그래서 현재의 레이아웃을 수정입니다 ... 물론 RelativeLayout (질문에 추가하지 않은 레이아웃)을 사용하도록 현재 레이아웃을 수정해야합니다.

관련 문제