Java 为什么TextInputItemText会产生此错误?

Java 为什么TextInputItemText会产生此错误?,java,android,fonts,Java,Android,Fonts,我一直在尝试将我的应用程序的fontfamily更改为Adventure pro。问题是只有我的textinputtext产生此错误 java.lang.RuntimeException: Font not found C:\Users\owner\AndroidStudioProjects\Application\app\src\main\res\font\advent_pro_medium.ttf 在按钮和textview上一切都正常。我还尝试过使用edittext,它不会产生此错误,但f

我一直在尝试将我的应用程序的
fontfamily
更改为Adventure pro。问题是只有我的
textinputtext
产生此错误

java.lang.RuntimeException: Font not found C:\Users\owner\AndroidStudioProjects\Application\app\src\main\res\font\advent_pro_medium.ttf
在按钮和
textview
上一切都正常。我还尝试过使用
edittext
,它不会产生此错误,但
fontfamine
没有得到应用。我的字体与错误所述的目录完全相同,那么为什么
textinputtext
会产生此错误?下面是我的
文本输入文本的代码

<android.support.design.widget.TextInputEditText
        android:id="@+id/etJoinCode"
        android:layout_width="match_parent"
        android:layout_height="35dp"
        android:fontFamily="@font/advent_pro"
        android:hint="@string/join_code"
        android:textColor="#ffff"
        android:textColorHint="#ffff"
        android:textSize="14sp" />

删除xml代码中的android:fontFamily=“@font/Adventure\u pro”

1.在
资产
目录中创建一个新的
字体
目录,并将
Adventure\u pro\u medium.ttf
字体文件放在此处。

Typeface tf = Typeface.createFromAsset(v.getContext().getAssets(), "fonts/advent_pro_medium.ttf");
etJoinCode.setTypeface(tf);
2.您可以更改此选项。

Typeface tf = Typeface.createFromAsset(v.getContext().getAssets(), "fonts/advent_pro_medium.ttf");
etJoinCode.setTypeface(tf);

删除这一行,然后尝试android:fontFamily=“@font/Adventure\u pro”这很有效,谢谢。有点恼人,我不能在xmlI中更改它。我不知道如何做。你也可以这样做。而且
fontfamine
在低版本中不起作用。