为了在layout.xml代码中不产生过多的冗余,于是就把一些修饰代码放到style中,但是放的时候注意了,格式

<style name="定义样式的唯一名称 主要方便通过资源id访问">
    <item name="属性的名称">属性的值</item>
    ...
</style>

放在style.xml文件中的<resources></resources>之间。

接下来我要记录一个导致报One or more layouts are missing the layout_width or layout_height attributes.错的错的写法One or more layouts are missing the layout_width or layout_height attributes.

没想到是name属性的值错了,导致在引用的时候没有反应。正确的写法是:

One or more layouts are missing the layout_width or layout_height attributes.

很小的一个错误,记录一下,安卓新手,请多多指教!

 

相关文章: