粗体样式未应用于某些活动的按钮,textview

时间:2018-04-09 21:15:19

标签: android android-layout android-activity textview android-styles

我遇到了android的问题,其中textviews和按钮没有在几个活动中获得textStyle粗体。我检查了主题,并与其他活动进行了比较,看起来都一样。但是textStyle粗体不起作用。我尝试过使用via代码和XML。有没有办法跟踪,调试和检查为什么textStyle粗体没有应用于几个活动?

我试过以下

textView.setTypeface(null, Typeface.BOLD);

以及

<TextView
                android:id="@+id/header_view"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:gravity="center"
                android:text="Continue"
                android:textStyle="bold" />

两者都不适合我。任何人都可以帮助为什么它不参加几项活动?

1 个答案:

答案 0 :(得分:0)

android:textStyle="bold"

这个命令总是让文字对我粗体。也许只是尝试清理项目。因为我们不需要构建项目来查找命令是否有效。对我来说,当我在我的xml文件中输入该命令时,它会立即在预览中使文本变为粗体。

相关问题