2012-11-05 5 views
0

지난 몇 시간 동안 미쳐 버렸습니다. 이 작업을 수행 할 수 없습니다 : 환경, 레이아웃 및 활동이 있습니다.레이아웃 내의 환경 설정 화면

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" > 
    <CheckBoxPreference 
     android:key="show_numbers" 
     android:title="show tile numbers" 
     android:summary="display the correct location of the tiles" 
     android:defaultValue="false" /> 
    <ListPreference 
     android:key="grid_size" 
     android:title="Grid Size" 
     android:summary="puzzle size" 
     android:entries="@array/gridSizeTitles" 
     android:entryValues="@array/gridSizeValues" 
     android:defaultValue="3" /> 
</PreferenceScreen> 

레이아웃 :

 <RelativeLayout xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="@drawable/mainbgcolor" xmlns:android="http://schemas.android.com/apk/res/android"> 

    <RelativeLayout 
     android:id="@+id/relativeLayoutHeader" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" > 

     <TextView 
      android:id="@+id/txtvHeader" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_centerHorizontal="true" 
      android:padding="20dip" 
      android:text="Sliding Puzzle" 
      android:textColor="#242FF0" 
      android:textSize="20dip" 
      android:textStyle="bold|normal" /> 

     <ImageView 
      android:id="@+id/ivHeader" 
      android:layout_width="50dip" 
      android:layout_height="50dip" 
      android:layout_centerVertical="true" 
      android:layout_toLeftOf="@+id/txtvHeader" 
      android:contentDescription="Sliding Puzzle Icon" 
      android:scaleType="fitCenter" 
      android:src="@drawable/slidingpuzzleicon" /> 
    </RelativeLayout> 


<LinearLayout 
     android:id="@+id/LinearLayoutContent" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_below="@+id/relativeLayoutHeader" 
     android:orientation="vertical" > 

<!-- THIS IS THE PLACE I WANT TO GET THE PREFERENCE. 
    I ALSO WANT BE ABLE TO POSITION THE PREFERENCE VIEWS. --> 

    </LinearLayout> 

</RelativeLayout> 

도움이 환영받을 것입니다하지만 난 선호 ... 레이아웃 내에서 우선 순위를 얻을 수 없습니다.

+1

나는 그렇게 생각하지 않습니다. 상위 화면을 가져 와서 거기에 레이아웃을 삽입 할 수있는 환경 설정 화면이있을 수 있지만 잘 모르겠습니다. – njzk2

답변

2
<!-- THIS IS THE PLACE I WANT TO GET THE PREFERENCE. 
    I ALSO WANT BE ABLE TO POSITION THE PREFERENCE VIEWS. --> 

olijf 사전에

덕분에, 그럼 당신은 오히려 PreferenceScreen를 사용하는 것보다, 그것을 위해 자신의 UI를 그릴해야합니다.

PreferenceScreen 시스템 뒤에있는 요점은 사용자가 기대하는 것과 UI 작동 방식을 알 수 있도록 환경 설정을 수집하는 표준화 된 방법을 제공하는 것입니다. 원하는 것은 환경 설정을 수집하는 비표준 방식을 구현하는 것입니다. 당신도 환영합니다.하지만 자신 만의 UI를 사용해야합니다.

관련 문제