<include layout="@*android:layout/preference_list_settings_header" />

<include layout="@*android:layout/preference_list_settings_header" />

代表引用的是framework中自己添加的未Public的布局文件

android:background="@android:drawable/iphone_activity_bg"

代表引用的是framwork中自己添加的public的图片

android中 类跳转的方式

android中 数据存储的方法

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要设置 `<PreferenceCategory>` 控件中的 `title` 字体大小和颜色,可以通过自定义主题(Theme)来实现。 首先,在 `styles.xml` 文件中定义一个主题,代码如下: ``` <style name="PreferenceCategoryTitleStyle"> <item name="android:textSize">18sp</item> <item name="android:textColor">#000000</item> <item name="android:textStyle">bold</item> </style> ``` 在上述代码中,我们设置了 `PreferenceCategoryTitleStyle` 主题的字体大小为 18sp,颜色为黑色,加粗。 接下来,在 `styles.xml` 文件中定义一个继承自 `Preference` 的样式,代码如下: ``` <style name="PreferenceCategoryStyle" parent="Preference"> <item name="android:layout">@layout/preference_category</item> <item name="android:titleTextStyle">@style/PreferenceCategoryTitleStyle</item> </style> ``` 在上述代码中,我们设置了 `PreferenceCategoryStyle` 样式的 `android:layout` 属性为自定义的 `preference_category` 布局文件,并设置了 `android:titleTextStyle` 属性为自定义的 `PreferenceCategoryTitleStyle` 主题。 接下来,在 `res/layout` 文件夹下新建一个名为 `preference_category.xml` 的布局文件,代码如下: ``` <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/title" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="?android:attr/listPreferredItemPaddingStart" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:minHeight="?android:attr/listPreferredItemHeightSmall" android:textAppearance="?android:attr/textAppearanceListItem" android:textColor="?android:attr/textColorPrimary" /> ``` 在上述代码中,我们使用一个普通的 TextView 控件作为 `PreferenceCategory` 的标题,并设置了一些默认的属性。 最后,在布局文件中使用自定义的 `PreferenceCategoryStyle` 样式,代码如下: ``` <PreferenceCategory android:key="allowed" android:title="@string/allowed_header" style="@style/PreferenceCategoryStyle" /> ``` 这样就可以设置 `<PreferenceCategory>` 控件中 `title` 的字体大小和颜色了。通过自定义主题和样式可以实现对所有 `Preference` 控件的样式统一管理和修改。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值