2011-12-06 2 views
4

내 응용 프로그램에 환경 설정 메뉴가 있습니다. Android 1.6을 사용하고 있습니다. 나는 화면 하단에 정적 저장 버튼을 사용하고 싶었다.기본 설정 메뉴에서 상대 레이아웃 사용

나는 android:layout_alignParentBottom="true"

<Button 
    android:id="@id/preferencesSaveButton" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:layout_gravity="center_horizontal" 
    android:layout_marginBottom="10dp" 
    android:layout_marginLeft="20dp" 
    android:layout_marginRight="20dp" 
    android:layout_marginTop="10dp" 
    android:padding="15dp" 
    android:text="Save" 
    android:textStyle="bold" /> 

우리가 상대 레이아웃 내부의 기본 설정을 사용하거나 그것을 할 다른 실제적인 방법이 사용하여 상대 레이아웃으로 작업을 수행하는 방법을 알아?

+0

가 너무 환경 설정 메뉴의 레이아웃 XML을 넣을 수 있습니다 .. 당신이 선호 활동이있는 경우에서 공유? – havexz

+0

@havexz 상대 레이아웃 내부에서 환경 설정을 사용할 수 있는지 알고 싶었습니다. – Antu

+1

이것이 원하는지 확인하십시오. http://stackoverflow.com/q/2697233/525978 – havexz

답변

2

탭 레이아웃에서 환경 설정 활동을 사용할 수 있으며 이는 실용적인 방법입니다. 탭 레이아웃은 상대 레이아웃을 가져야합니다. tabhost 중 하나에서 의도적으로 환경 설정 활동을 사용할 수 있습니다. 나는 그것이 자동으로 기본 설정을 저장합니다 .. 당신이이 우선 버튼을 저장할 필요가 그렇게 생각하지 않습니다 및

<?xml version="1.0" encoding="utf-8"?> 

    <TabHost android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:id="@android:id/tabhost" 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    > 
    <RelativeLayout 
    android:layout_height="fill_parent" 
    android:layout_width="fill_parent"> 

    <FrameLayout 
    android:id="@android:id/tabcontent" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_above="@android:id/tabs" 
    android:padding="5dp" /> 

    <TabWidget 
    android:id="@android:id/tabs" 
    android:layout_alignParentBottom="true" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" /> 
</RelativeLayout> 
    </TabHost> 
+0

Sanjay Herle 대단히 감사합니다. – Antu