<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="TextViewAppearance" parent="@android:style/TextAppearance.Widget.TextView">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="typeface">robotoRegular</item>
</style>
<style name="TextViewAppearance.Display1" parent="@style/TextViewAppearance">
<item name="typeface">robotoBlack</item>
<item name="android:textSize">45sp</item>
<item name="android:textColor">@color/main_color_grey_500</item>
</style>
</resources>
Getting Error: Error:(4, 5) No resource found that matches the given name: attr 'typeface'.
I'm using
1. Android Studio 1.5.1
2. minSdkVersion 15
3. targetSdkVersion 23
<----------- Edit --------------------->
My Layout file is
<abcapp.com.font.RobotoTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="ABC"
android:textSize="16sp"
app:typeface="robotoBlack" />
The Typeface class specifies the typeface and intrinsic style of a font.
You should call android:typeface
instead of typeface
.
Don't
<item name="typeface">robotoRegular</item>
Do
<item name="android:typeface">robotoRegular</item>
you should use android:typeface
,not typeface
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With