Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/189.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我正在尝试构建android应用程序,但xml中有一个错误_Android_Layout_Android Linearlayout - Fatal编程技术网

我正在尝试构建android应用程序,但xml中有一个错误

我正在尝试构建android应用程序,但xml中有一个错误,android,layout,android-linearlayout,Android,Layout,Android Linearlayout,错误为未指定方向,默认为水平方向。这是动态添加子项时常见的错误源。set <!-- Footer Start --> <LinearLayout android:id="@+id/footer" android:layout_width="fill_parent" android:layout_height="40dip" android:background="@layou

错误为
未指定方向,默认为水平方向。这是动态添加子项时常见的错误源。

set

<!-- Footer Start -->
    <LinearLayout
            android:id="@+id/footer"
            android:layout_width="fill_parent"
            android:layout_height="40dip"
            android:background="@layout/footer_repeat"
            android:layout_alignParentBottom="true">
    </LinearLayout>
<!-- Footer Ends -->
对于
线性布局

添加到您的
线性布局

android:orientation="vertical"


是一种扫描Android项目源代码以查找潜在bug的工具

您应该添加
android:orientation=“horizontal”
android:orientation=“vertical”

LinearLayout
块中,即。重写为

  <LinearLayout
        android:id="@+id/footer"
        android:layout_width="fill_parent"
        android:layout_height="40dip"
        android:orientation="horizontal"
        android:background="@layout/footer_repeat"
        android:layout_alignParentBottom="true">
</LinearLayout>


线性布局是否包含任何子项?如果没有,则只需再次进行
清理
构建
,否则请放置一些
方向
android:orientation=“vertical”
android:orientation=“horizontal”
android:orientation="horizontal"
  <LinearLayout
        android:id="@+id/footer"
        android:layout_width="fill_parent"
        android:layout_height="40dip"
        android:orientation="horizontal"
        android:background="@layout/footer_repeat"
        android:layout_alignParentBottom="true">
</LinearLayout>
  <LinearLayout
            android:id="@+id/footer"
            android:layout_width="fill_parent"
            android:layout_height="40dip"
            android:background="@layout/footer_repeat"
            android:orientation="vertical"
            android:layout_alignParentBottom="true">
    </LinearLayout>
<!-- Footer Start -->
<LinearLayout
        android:id="@+id/footer"
        android:layout_width="fill_parent"
        android:layout_height="40dip"
        android:background="@layout/footer_repeat"
        android:layout_alignParentBottom="true"
        android:orientation="vertical" ><!-- or horizontal -->

</LinearLayout>
<!-- Footer Ends -->