Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/227.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android:在膨胀xml文件之前将字体系列设置为textview_Android_Android Inflate - Fatal编程技术网

Android:在膨胀xml文件之前将字体系列设置为textview

Android:在膨胀xml文件之前将字体系列设置为textview,android,android-inflate,Android,Android Inflate,我想将font-family设置为Textview 但我希望在加载xml 我的代码: for(int i=0;i++;i您可以使用绑定。查看如果您不介意使用第三方库,我建议您尝试一下。您可以在GitHub页面上找到所需的一切,它非常容易使用 您只需在应用程序类和活动类中进行设置,将字体放在资产文件夹中,然后就可以使用XML中的字体,如下所示: <TextView android:text="@string/hello_world" android:layout_width=

我想将
font-family
设置为
Textview

但我希望在加载
xml

我的代码:


for(int i=0;i++;i您可以使用绑定。查看如果您不介意使用第三方库,我建议您尝试一下。您可以在GitHub页面上找到所需的一切,它非常容易使用

您只需在应用程序类和活动类中进行设置,将字体放在资产文件夹中,然后就可以使用XML中的字体,如下所示:

<TextView
    android:text="@string/hello_world"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    fontPath="fonts/Roboto-Bold.ttf"/>

您正在创建大量文本视图>>>为什么需要
100000文本视图
<TextView
    android:text="@string/hello_world"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    fontPath="fonts/Roboto-Bold.ttf"/>