Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

May we annotate style for TargetApi in android

I am trying to define the style

<style name="robotoCondensed">
    <item name="android:fontFamily">sans-serif-condensed</item>
    <item name="android:textStyle">normal</item>
</style>

but fontFamily is not available for api 10, which I am using. So is there a way to use annotation in a stylesheet? Such as maybe @TargetAPI?

like image 388
Katedral Pillon Avatar asked Dec 19 '22 00:12

Katedral Pillon


1 Answers

Add the xmlns:tools="http://schemas.android.com/tools" definition to your top-level XML tag, and then just add tools:targetApi="10" to the item defining fontFamily.

like image 87
Martin Avatar answered Mar 03 '23 10:03

Martin