洋洋330 2022-01-14 11:52 采纳率: 0%
浏览 20

使用SmartRefreshLayout+RecyclerView显示灰色页面

我是一位初学者,当我用下面代码编写的时候出现的界面是灰色的,但其实我想实现第一个图片的效果。不知道应该怎么去处理,请求大家指点。
我在build.gradle中添加了implementation 'androidx.recyclerview:recyclerview:1.0.0',

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"

<com.youth.banner.Banner
    android:visibility="gone"
    android:id="@+id/fragment_show_banner"
    android:layout_width="match_parent"
    android:layout_height="200dp"
    app:indicator_height="0dp"
    app:indicator_width="0dp"
    app:indicator_drawable_selected="@drawable/text_gridient_theme"
    app:indicator_drawable_unselected="@drawable/circle_write">

</com.youth.banner.Banner>


<RelativeLayout
    android:id="@+id/rlt_top"
    android:layout_width="match_parent"
    android:layout_height="45dp"
    android:background="@color/mycolor_theme">

    <TextView
        android:id="@+id/tv_back"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:text="  返回   "
        android:textColor="@color/white"
        android:textSize="14sp"
        android:visibility="gone" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:text="餐品"
        android:textColor="@color/mycolor_ffffff"
        android:textSize="16sp" />

    <TextView

        android:id="@+id/tv_add"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:text="     "
        android:textColor="@color/white"
        android:textSize="14sp"
        android:visibility="visible" />
</RelativeLayout>


<com.scwang.smart.refresh.layout.SmartRefreshLayout
    android:id="@+id/refreshLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">


    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/recycleview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

</com.scwang.smart.refresh.layout.SmartRefreshLayout>

img

img

  • 写回答

2条回答 默认 最新

  • 俺不理解 2022-01-14 13:38
    关注

    RecycleView 也是 match_parent

    评论

报告相同问题?

问题事件

  • 创建了问题 1月14日

悬赏问题

  • ¥15 我这模型写的不对吗?为什么lingo解出来的下面影子价格这一溜少一个变量
  • ¥50 树莓派安卓APK系统签名
  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波