Je deviens fou pendant les dernières heures. Je ne peux pas obtenir ce travail: J'ai une préférence, une mise en page et une activité. mais je ne peux pas obtenir la préférence au sein de la mise en page ... préférence:écran de préférence dans la disposition
<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>
mise en page:
<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>
toute aide serait la bienvenue.
merci à l'avance, olijf
Je ne pense pas que vous pouvez le faire. peut être avec un écran de préférence, vous pouvez aller chercher la vue de dessus et injecter votre mise en page là, mais je ne suis même pas sûr. – njzk2