无法在布局文件中添加android自定义文本视图 [英] android custom text view can not be added in layout file
问题描述
我创建了一个自定义文本视图只是为了解决我之前的问题
I have created a custom text view just to solve the problem in my previous question
我已经阅读了许多教程和示例。我已经创建了一个自定义文本视图,但是不能将其添加到任何布局文件中。它只是在布局文件上引发错误,指出未找到该类。但是我写的是同一堂课。
I have gone through many tutorials and many samples. I have created a custom text view but it can not be added into any layout file. It just throws an error on layout file stating that the class is not found. However I have written the same class.
我想知道的是,创建自定义文本视图时需要注意些什么?我唯一的要求是创建一个自定义文本视图,以在我使用的所有文本视图中使用arial字体。
What i want to know is what should i need to take care when i am creating a custom text view? My only requirement to create a custom text view to have the arial fonts in all text views i use. And extend this facility for button views also.
谢谢
推荐答案
您只需使用完整的包名称和类添加视图:
You just add your view with full package name and class:
<org.path.to.MyTextView
android:id="@+id/MyTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
这篇关于无法在布局文件中添加android自定义文本视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!