这两天为了完善App的功能学习了一下Preference制作一个设置界面,记录一下。
创建布局
首先res里创建一个xml文件夹,然后新建xml文件建议名称为"perf_xxx"
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:key="setting"
android:title="用户设置" />