Question

I want to change the font of the Action Bar Title, Tabs and Menu Items to Roboto.

I am trying to figure out if this can be done via Styles ? since i am not able to create a custom view for these which is the best way to assign the custm font.

I have gone through the following links

https://stackoverflow.com/a/14681975/155196

How to Set a Custom Font in the ActionBar Title?

Was it helpful?

Solution

Here's a code that did it for me:

<style name="AppTheme" parent="AppBaseTheme">
    ...
    <item name="android:typeface">serif</item>
    ...
</style>

Look here for what fonts are available by default on android. From what I read adding other fonts is not possible without sub-classing your views, so I can't help you there.

EDIT: I may be wrong. Check this out: http://www.jayway.com/2013/01/22/custom-typeface-in-android/ and here: http://www.androidguys.com/2008/08/18/fun-with-fonts/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top