相对布局中的方向属性是否负责对获得的最终布局视图进行任何更改?

Is the orientation attribute in relative layout responsible to make any changes to the final layout view obtained?

我一直在尝试预览 android 中给定 XML 代码的布局:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="@dimen/list_item_height"
android:background="@color/tan_background"    
tools:context="com.example.android.miwok.ColorsActivity">
<ImageView
    android:id="@+id/image"
    android:src="@mipmap/ic_launcher"
    android:layout_width="@dimen/list_item_height"
    android:layout_height="@dimen/list_item_height"
    />
<LinearLayout
    android:id="@+id/text_container"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_alignParentBottom="true"
    android:layout_alignParentTop="true"
    android:layout_height="@dimen/list_item_height"
    android:layout_toRightOf="@id/image">
</LinearLayout>


</RelativeLayout>

结果是https://i.stack.imgur.com/jzhir.png 但是现在我发现,每当我试图从相同代码的相对布局父视图组中删除方向属性时(如果我描述有误,请纠正我),我发现正在获取相同的预览。 进行上述改动后得到的视图如下所示 https://i.stack.imgur.com/MNbKF.png 。这是否意味着我们是否在相对布局中放置任何方向属性并不重要?或者android.

中XML相对布局的orientation属性有没有隐藏的后果

您可以在 docs 中看到 RelativeLayout 没有方向参数。