Android - set TextView TextStyle programmatically?

前端 未结 11 652
南旧
南旧 2020-12-02 05:04

Is there a way to set the textStyle attribute of a TextView programmatically? There doesn\'t appear to be a setTextStyle() method.

11条回答
  •  广开言路
    2020-12-02 05:50

    This worked for me

    textview.setTypeface(textview.getTypeface(), Typeface.BOLD);
    

    or

    textview.setTypeface(Typeface.DEFAULT_BOLD);
    

提交回复
热议问题