网上一些资料说要重写CheckBoxPreference,重写虽然能实现,考虑到如果要改动的地方比较多,重写显然不是最好的方法。其实通过实验有个layout接口可以直接自定义。
<CheckBoxPreference
android:key="try"
android:title="@string/try"
android:persistent="false"
android:summary="flytest"
android:layout="@layout/checkboxlayout"
android:disableDependentsState="true" />
checkboxlayout.xml
这里面可以设置textSize,亲测有效。公司电脑加密了,只能截图。