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"/>