学徒COS 2016-04-12 10:17 采纳率: 100%
浏览 1620
已采纳

#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>


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

  • 写回答

1条回答 默认 最新

  • 学徒COS 2016-04-12 10:47
    关注

    我去。我搞定了。这是代码。留给后人
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/LinearLayout2"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    tools:context="${packageName}.${activityClass}" >

    <EditText
        android:id="@+id/TitleEditText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
         android:hint="@null"
        android:ems="10" />
    
    <EditText
        android:id="@+id/ContentEditText"
        android:layout_width="fill_parent"
        android:layout_weight="0.86"
        android:layout_height="0dp"
         android:hint="@null"
        android:ems="10" >
    </EditText>
    
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" >
    
        <Button
            android:id="@+id/AddButton"
            android:layout_height="wrap_content"
            android:layout_width="160dp"
            android:text="增加" />
    
        <Button
            android:id="@+id/SearchButton"
            android:layout_width="160dp"
            android:layout_height="wrap_content"
            android:layout_weight="1.14"
            android:text="查看" />
    
    </LinearLayout>
    

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog