您好,我正在优先处理消息设置。
我正在尝试更改 CheckboxPreference 的 android:title 和 android:summary 文本字体大小。
为此我正在尝试下面的代码
<PreferenceCategory
android:key="prefcategory1"
android:title="GENERAL SETTINGS..." >
<CheckBoxPreference
android:defaultValue="false"
android:enabled="true"
android:key="checkBoxdelete"
android:layout="@layout/mylayout" <!--linking it to mylayout.xml -->
android:summary="Deletes old messages as limits are reached"
android:title="Delete old messages" />
</PreferenceCategory>
和mylayout.xml
<TextView android:id="@+android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:textColor="#FFFFFF"
android:textSize="30px"
android:textStyle="bold"/>
<TextView android:id="@+android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:textColor="#FFFFFF"
android:textSize="20px"
android:textStyle="bold"/>
通过使用它,文本大小会增加,如下面的屏幕截图所示。但是,我看不到复选框。我该如何解决这个问题?
最佳答案
这里的大多数答案都是完全错误的,或者在有更简单的方法可以实现相同操作时过于复杂而无法实现。
仅供将来的读者使用 - 您可以在 styles.xml
中更改 textSize/textColor
<style name="PreferencesTheme" parent="@android:style/Theme.Black">
<item name="android:textSize">34sp</item>
<item name="android:textColorSecondary">#000000</item>
<item name="android:textColorPrimary">#000000</item>
</style>
其中 textColorPrimary
将更改 checkBoxPreference 标题的颜色,而 textColorSecondary
将更改摘要的颜色。
关于android - 增加 CheckboxPreference 标题和摘要文本大小以及首选项条目的发光,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18787499/