首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何解决在RecyclerView中match_parent宽度不起作用?

如何解决在RecyclerView中match_parent宽度不起作用?

提问于 2018-05-02 00:02:39
回答 2关注 0查看 423

我的RecyclerView和item具有match_parent宽度,但结果是:

在这里输入图像描述
在这里输入图像描述
代码语言:javascript
复制
    <view
    class="android.support.v7.widget.RecyclerView"
    android:layout_width="match_parent"

和项目:

代码语言:javascript
复制
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:id="@+id/ll_itm"
android:orientation="horizontal"
android:layout_width="match_parent"

full:

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:id="@+id/ll_itm"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="100"
android:gravity="right"
>


<Button
    android:layout_width="0dp"
    android:layout_weight="15"
    android:layout_height="fill_parent"
    android:text="ملاحظات"
    android:id="@+id/button" />

<LinearLayout
    android:layout_width="0dp"
    android:layout_height="fill_parent"
    android:layout_weight="20"
    android:gravity="center"
    >
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        >

        <com.getbase.floatingactionbutton.FloatingActionButton
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            fab:fab_plusIconColor="#ff56ff83"
            fab:fab_colorNormal="@color/d_red"
            fab:fab_colorPressed="#ff5c86ff"
            fab:fab_size="mini"
            fab:fab_icon="@drawable/ic_remove_white"
            android:id="@+id/fab_rmv" />
        <esfandune.ir.elmikarbordiardakan.other.CustomTxtView
            android:layout_weight="25"
            android:layout_width="0dp"
            android:layout_height="fill_parent"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:text="0"
            android:gravity="right|center_vertical"
            android:id="@+id/txt_takhir_itm" />
        <com.getbase.floatingactionbutton.FloatingActionButton
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            fab:fab_plusIconColor="@color/colorprimarylight"
            fab:fab_colorNormal="@color/colorprimarydark"
            fab:fab_colorPressed="@color/colorprimary"
            fab:fab_size="mini"
            fab:fab_icon="@drawable/ic_add_white"
            android:id="@+id/fab_add" />

    </LinearLayout>
</LinearLayout>
    <Spinner
        android:layout_width="0dp"
        android:layout_height="fill_parent"
        android:layout_weight="10"
        android:id="@+id/sp_nomre_itm"

        android:entries="@array/degrees"/>


<LinearLayout
    android:layout_width="0dp"
    android:layout_height="fill_parent"
    android:layout_weight="10"
    android:gravity="center"
    >
    <!--LinearLayout baraye ine ke nameshod fab ro weight behosh dad-->
    <com.getbase.floatingactionbutton.FloatingActionButton
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        fab:fab_plusIconColor="#ff56ff83"
        fab:fab_colorNormal="@color/d_green"
        fab:fab_colorPressed="@color/d_orange"
        fab:fab_size="normal"
        fab:fab_icon="@drawable/ic_done_white"
        android:id="@+id/fab_hazr" />



</LinearLayout>
<esfandune.ir.elmikarbordiardakan.other.CustomTxtView
    android:layout_weight="5"
    android:layout_width="0dp"
    android:layout_height="fill_parent"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:text="100"
    android:gravity="right|center_vertical"
    android:id="@+id/txt_ghybtNumber_itm" />

<esfandune.ir.elmikarbordiardakan.other.CustomTxtView
        android:layout_weight="30"
        android:layout_width="0dp"
        android:layout_height="fill_parent"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="عباسعلی ملاحسینی اردکانی"
        android:gravity="right|center_vertical"
        android:id="@+id/txt_title_itm"
    android:layout_marginRight="10dp"
    />

<view
    android:layout_width="0dp"
    android:layout_height="fill_parent"
    android:layout_weight="10"
    class="de.hdodenhof.circleimageview.CircleImageView"
    android:id="@+id/view"
    android:src="@drawable/mmrdf"
   />
</LinearLayout>
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档