问题
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