android - 以编程方式使用 setTextSize 到 ?attr/textAppearanceLarge

标签 android textview

我现在正在修改自定义首选项,我想使用 TextView 为其添加标签。但是我似乎找不到使用 setTextView() 将文本大小指定为“大”的方法

我在这里错过了什么?

最佳答案

TextView title = new TextView(context);
title.setTextAppearance(context, android.R.attr.textAppearanceLarge);

或者试试

setTextAppearance(context, android.R.style.TextAppearance_Large);

使用上面的代码试试

关于android - 以编程方式使用 setTextSize 到 ?attr/textAppearanceLarge,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10178024/

相关文章:

android - 滚轮菜单栏如何为图标提供点击操作

android - 将 lib 上传到 bintray.com 时无法通过电子邮件获取 gpg key

java - 当 2 个条件为 true 时从 JSON 获取值

java - 我的 TextView 不支持这个 (') 字符

android - 匹配 <intent-filter> 中的 url 模式

android - 检查输入时间在android中的两个时间范围之间

java - 如果 TextView 大于 1 行,如何在 TextView 上显示省略号?

android - 检查TextView是否已满

android - Android TextView 中的重叠问题

android - ViewPager 里面的 TextView 拦截触摸事件