8
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

TextViewをコードからBOLDにする方法

Last updated at Posted at 2016-04-29

#TextViewをコードからBOLDにする
http://endoidou.hatenablog.com/entry/2016/04/29/182452

##xmlから指定するとこんな感じ

<TextView
    android:id="@+id/hoge_text"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textStyle="bold"
    android:text="hogehoge"
/>

###これをコードからやりたい

TextView hogeText = (TextView) findViewById(R.id.hoge_text);
hogeText.setTypeface(Typeface.DEFAULT_BOLD);

###これでOK

8
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?