在android xml文件中为布局内容创建别名

时间:2012-08-21 09:01:24

标签: android xml android-layout android-linearlayout

我已经创建了一个继承自TextView的类,所以现在我必须使用我的实现:

<cdz.chapitreUn.preums.BoldTextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world"
        tools:context=".PreumsActivity" />

在xml文件上。事情是这是一个非常长的语法,包括类的路径,无论如何(别名或别的东西)我只能写:

<BoldTextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world"
        tools:context=".PreumsActivity" />

谢谢

0 个答案:

没有答案