
1. 首先生成一个preferencescreen的xml文件..看代码:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="">
<CheckBoxPreference
android:key="check1"
android:title="音乐"
android:summary="adas"
/>
<CheckBoxPreference
android:key="autoBack"
android:summaryOn="开启"
android:summaryOff="关闭"
android:defaultValue="true"
/>
<!-- 这里是我自定义的Preference,详细代码请看下面
android:dialogLayout="@layout/setting_widthseekbar"
这个就是弹出窗口后要显示的布局文件..这个大家想显示成什么样子.自己设置了
-->
<preferenceScreen.hall.SeekBarPreference
android:key="sss"
android:title="111"
android:dialogTitle="333"
android:dialogLayout="@layout/setting_widthseekbar"
android:persistent="true"/>
<PreferenceCategory android:title="SMS 助手">
<CheckBoxPreference
android:key="smsSilence"
android:title="静音"
android:summaryOn="开启"
android:summaryOff="关闭"
android:defaultValue="false"
/>
<PreferenceScreen android:title="更多选项">
<CheckBoxPreference
android:key="cb21"
android:title="功能1"
android:summaryOn="开启"
android:summaryOff="关闭"
android:defaultValue="true"
/>
<CheckBoxPreference
android:key="cb22"
android:title="功能2"

android:summaryOn="使用"
android:summaryOff="停用"
android:defaultValue="true"
/>
<ListPreference
android:key="list1"
android:title="android forum"
android:summary="开坛"
android:dialogTitle="请选择论坛"
android:entries="@array/entries"
android:entryValues="@array/entryvalue"
/>
<EditTextPreference
android:key="et1"
android:title="EditTextPreference Sample"
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/ruanjian/article-52956-1.html
其实美帝来了12海里又怎么样