开发者社区> 问答> 正文

#15: You must supply a layout_height attribute

xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/LinearLayout2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="${packageName}.${activityClass}" >
<EditText
    android:id="@+id/TitleEditText"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:ems="10" />

<EditText
    android:id="@+id/ContentEditText"
    android:layout_width="match_parent"
    android:layout_weight="0.86"
    android:layout_height="wrap_content"
    android:ems="10" >

    <requestFocus />
</EditText>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <Button
        android:id="@+id/AddButton"
        android:layout_height="wrap_content"
        android:layout_weight="17.48"
        android:text="增加" />

    <Button
        android:id="@+id/SearchButton"
        android:layout_width="160dp"
        android:layout_height="wrap_content"
        android:layout_weight="1.14"
        android:text="查看" />

</LinearLayout>

报错如上;表示看不懂哪里错了。

展开
收起
爵霸 2016-03-05 13:59:24 2769 0
1 条回答
写回答
取消 提交回答
  • 意思是在布局文件中,某一个View节点必须设置 layout_height
    2019-07-17 18:53:23
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Why you should care about data layout in the file system 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载