【问题标题】:Android set text style programmaticallyAndroid以编程方式设置文本样式
【发布时间】:2012-07-23 09:11:10
【问题描述】:

我需要访问以下 -

android:textStyle(of a digital clock control) 

以编程方式,我该怎么做?

【问题讨论】:

标签: android


【解决方案1】:

【讨论】:

    【解决方案2】:

    对于文本视图:

    TextView tv = (TextView) findViewById(R.id.tv);
    

    设置字体tv.setTypeface(tf);

    要获取当前字体集,请使用tv.getTypeface();

    【讨论】:

      猜你喜欢
      • 2020-10-06
      • 1970-01-01
      • 2018-11-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-11
      • 2012-04-12
      • 2019-01-01
      相关资源
      最近更新 更多