【发布时间】:2013-05-11 13:47:36
【问题描述】:
如果我有很多 TextViews 作为项目标签,我想我可以将它们的所有共同点提取到一个样式中,并且只在布局中使用
<TextView style="@style/label" android:text="Foo"/>
<TextView style="@style/label" android:text="Bar"/>
风格如下:
<style name="label">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
</style>
但是当我这样做时,它在模拟器和设备上运行良好,但 Android XML 编辑器抱怨 "<TextView>" does not set the required layout_height attribute.
为什么它报告此警告有什么原因吗?
【问题讨论】:
标签: android eclipse android-layout adt