android custom text view can not be added in layout file

*爱你&永不变心* 提交于 2019-12-13 17:43:02

问题


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.

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.

Thanks


回答1:


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


来源:https://stackoverflow.com/questions/4397205/android-custom-text-view-can-not-be-added-in-layout-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!