<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/hello_world" />
    <Button 
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/hello_world" />
</LinearLayout>
Eclipse提示:第一句有误。
明明没错啊,这怎末一回事。

解决方案 »

  1.   

    我粘贴到我的eclipse,提示是正确的,你新建一个工程看看
      

  2.   

    我在我这里测试也是正常的,楼主先保存,然后编译一下,还不行的话 先clean一下工程,再编译应该就没问题了。
      

  3.   

    你不会看提示么,api18要求线性布局都要有oration..<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >    <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/hello_world" />    <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/hello_world" /></LinearLayout>
      

  4.   

    楼上说的应该靠谱,我也觉得是少了orientation 就是布局方向,是竖直还是横着
      

  5.   

    布局默认是orientation,可能是电脑没反应过来,要不就是 从第一行,开始写起,或者格式化下catr+shift+f
      

  6.   

    不写ori那个系统默认就是水平方向
      

  7.   

    你的那个TextView和Button就默认是在同一行, 但是你给他们的属性,全都是match_parent。你把宽删除了,加个权重,应该就ok了!