android 5 字体大小,自定义首选项标题字体大小大于android 5中的标准首选项

我的应用程序具有自定义布局的自定义首选项,在

Android 5上尝试我的应用程序后,我注意到我的自定义首选项看起来与其他首选项不同(字体大小,颜色,填充).所以我认为只需从android 5 SDK中获取preference.xml,与我的更改合并并将新布局放置到layout-v21文件夹即可.它修复了填充和颜色问题,但没有更大的标题大小.

我的自定义首选项构造函数如下所示:

public SeekBarPreference(Context context, AttributeSet attrs) {

super(context, attrs);

setLayoutResource(R.layout.preference_seekbar);

}

preference_seekbar.xml(刚刚将Seekbar添加到原始布局):

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:minHeight="?android:attr/listPreferredItemHeight"

android:gravity="center_vertical"

android:paddingEnd="?android:attr/scrollbarSize"

android:background="?android:attr/selectableItemBackground" >

android:id="@+android:id/icon"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="center"

/>

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_marginStart="15dip"

android:layout_marginEnd="6dip"

android:layout_marginTop="6dip"

android:layout_marginBottom="6dip"

android:layout_weight="1">

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:singleLine="true"

android:textAppearance="?android:attr/textAppearanceLarge"

android:ellipsize="marquee"

android:fadingEdge="horizontal" />

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_below="@android:id/title"

android:layout_alignStart="@android:id/title"

android:textAppearance="?android:attr/textAppearanceSmall"

android:textColor="?android:attr/textColorSecondary"

android:maxLines="4" />

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_below="@+android:id/title"

android:layout_toEndOf="@android:id/summary"

android:layout_toStartOf="@android:id/widget_frame"/>

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:gravity="center_vertical"

android:orientation="vertical" />

你可以注意到上面的标题小部件有这个原始属性:android:textAppearance =“?android:attr / textAppearanceLarge”这应该使字体变大,但是如果它使用相同的布局,那么有一个问题为什么标准首选项标题字体大小更小(只有没有搜索栏)?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值