Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/192.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 studio中没有android:layout__Android_Android Layout - Fatal编程技术网

android studio中没有android:layout_

android studio中没有android:layout_,android,android-layout,Android,Android Layout,我试图在我的线性布局下放置一个recyclerview,但是没有用于recyclerview的android:layout\u选项! 然后我尝试将我的recyclerview放入一个LinearLayout,并在下面为该布局设置布局,但也没有为LinearLayout设置布局 对不起,我英语不好,但不管怎样。。。以下是我的XML: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmln

我试图在我的线性布局下放置一个recyclerview,但是没有用于recyclerview的android:layout\u选项! 然后我尝试将我的recyclerview放入一个LinearLayout,并在下面为该布局设置布局,但也没有为LinearLayout设置布局

对不起,我英语不好,但不管怎样。。。以下是我的XML:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="tablo.mirshekari.customers.StoreFragment">

<LinearLayout
    android:id="@+id/store_view"
    android:layout_width="match_parent"
    android:layout_height="200dp"
    android:gravity="right"
    android:paddingRight="20dp"
    android:paddingTop="20dp"
    android:background="@color/cardview_dark_background"
    android:orientation="vertical">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="45dp"
        android:gravity="right"
        android:paddingTop="10dp"
        android:background="@color/cardview_dark_background"
        android:orientation="horizontal">
    <TextView
        android:layout_width="match_parent"
        android:layout_height="30dp"
        android:text="lasjdbkajbd"
        android:textColor="@color/white"
        android:paddingRight="10dp"
        android:layout_gravity="right"
        android:gravity="right|center_vertical"
        android:id="@+id/store_name" />
    <ImageView
        android:layout_width="30dp"
        android:layout_height="30dp"
        android:src="@drawable/ic2w"
        android:layout_gravity="right"
        />

</LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:gravity="right"
        android:background="@color/cardview_dark_background"
        android:orientation="horizontal">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="30dp"
            android:text="lasjdbkajbd"
            android:textColor="@color/white"
            android:paddingRight="10dp"
            android:layout_gravity="right"
            android:gravity="right|center_vertical"
            android:id="@+id/store_textposition" />
        <ImageView
            android:layout_width="30dp"
            android:layout_height="30dp"
            android:src="@drawable/address_white"
            android:layout_gravity="right"
            />

    </LinearLayout>

</LinearLayout>

<android.support.v7.widget.RecyclerView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    ></android.support.v7.widget.RecyclerView>
</FrameLayout>

据我所知,下面的
布局仅适用于
RelativeLayout
。见和

这意味着您必须将视图放入RelativeLayout中才能使用该属性

更新


是的,您正在将视图放到
框架布局中。考虑用垂直方向将其改为<代码>线性布局< /代码>或使用<代码> ReloLayOutOut<<代码> > <>代码>  > <代码> CurryReVIEW  

< P> >据我所知,<>代码> > />代码>仅适用于<代码> RealValayOut。见和

这意味着您必须将视图放入RelativeLayout中才能使用该属性

更新

是的,您正在将视图放到
框架布局中。考虑使用垂直方向将其改为<代码>线性布局< /代码>或使用<代码> RelialayOut< <代码> > <>代码>  > <代码> RealReVIEW  .< /P> < P>线性布局不包含Android:LayOutuin选项。
因此,您可以使用相对布局代替线性布局来使用下面的android:layout\u选项。

线性布局不包含下面的android:layout\u选项。
因此,您可以使用相对布局代替线性布局来使用android:layout\u下方的选项。

在这里发布您的代码。不要使用外部链接(尤其是需要登录的链接)。这样,如果链接关闭,用户仍然可以阅读您的问题。@MichaelVescovo抱歉我编辑了它。您应该尝试一下
ConstraintLayout
。这是所有模板的默认设置,现在将代码发布到这里。不要使用外部链接(尤其是需要登录的链接)。这样,如果链接关闭,用户仍然可以阅读您的问题。@MichaelVescovo抱歉我编辑了它。您应该尝试一下
ConstraintLayout
。现在它是所有模板的默认设置