【发布时间】:2011-04-19 07:56:18
【问题描述】:
我想在我的 xml 布局中使用 include 标记来回收公共布局部分。
Android 文档说我可以修改导入布局的某些属性,例如
<include layout="@layout/topbar" />
包括不指定宽度和高度的顶部栏布局。
<include layout="@layout/topbar" android:layout_width="fill_parent" />
包括具有特定宽度的顶栏布局。
那么,在我的顶栏布局中,我有一个没有文本的 textview,我可以从下面的包含标签中设置 textview 文本吗?
<include layout="@layout/topbar" android:text="Hello world" />
谢谢。
【问题讨论】:
-
开发问题不在此处,请参阅常见问题解答android.stackexchange.com/faq,您最好在StackOverflow.com 上提问