Saturday 3 November 2018

android - How to specify font style in TextView

I want to implement different font in different TextViews.



I am trying to implement fonts from assets with this.



tf = Typeface.createFromAsset(v.getContext().getAssets(), "Roboto.ttf");
bellow_name.setTypeface(tf);


But I have TextView something like this



((TextView) findViewById(R.id.news_date)).setText(news.news_date);


How can I implement Typeface with above TextView?

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...