5

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?

4

1 回答 1

4

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/

于 2013-03-30T13:26:36.307 回答