Chen Kinnrot
Chen Kinnrot

Reputation: 21015

Android set text style programmatically

I need to access the following -

android:textStyle(of a digital clock control) 

programmatically, how do I do this?

Upvotes: 2

Views: 3387

Answers (2)

Vins
Vins

Reputation: 4119

For a textview :

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

To set the typeface tv.setTypeface(tf);

To get the current typeface set use tv.getTypeface();

Upvotes: 1

vasart
vasart

Reputation: 6702

Use setTypeface(typeface, style)

Upvotes: 6

Related Questions