0
  • 最佳答案

    上布局代码,另外我问你一下:刷新是哪个控件完成的?

    1153952789488054272  评论     打赏       拉大锯
    • 二两仙气儿  回复 @拉大锯
      刷新UI是在fragment里面,网络请求成功时 -> upRecommendUI() -> 调用Adapter里的setData。
      二两仙气儿 2022-06-10 17:41   回复 1535191548881276930
    • 拉大锯  回复 @二两仙气儿
      补充你布局的代码,再编辑问题一下。那个只是更新列表,你要有一个控件,RecyclerView不支持下拉刷新,上拉加载更多。
      拉大锯 2022-06-10 17:45   回复 1153952789488054272
    • 二两仙气儿  回复 @拉大锯
      喔...但是我看完P11后,视频中跑起来后列表里面数据不止10个....而且超过屏幕的可以拉到下面看
      二两仙气儿 2022-06-10 17:50   回复 1535191548881276930
    • 拉大锯  回复 @二两仙气儿
      超过一页数据就可以往下滚动,RecyclerView支持滚动,也就是列表数据。
      拉大锯 2022-06-10 17:53   回复 1153952789488054272
    • 二两仙气儿  回复 @拉大锯
      那就是说现在喜马拉雅获取到的 推荐内容 就是10条吗? 因为没有超过一页所以 没办法 再往下滚动了? 刷新的事我明白了,我刚才提问的叙述有问题。
      二两仙气儿 2022-06-10 17:55   回复 1535191548881276930
    • 拉大锯  回复 @二两仙气儿
      是不是10条,你打log,看你的参数。
      拉大锯 2022-06-10 17:57   回复 1153952789488054272
    • 二两仙气儿  回复 @拉大锯
      阿里嘎都!
      二两仙气儿 2022-06-10 17:59   回复 1535191548881276930
  • 结案了...,我想的很对 从喜马拉雅获取的推荐内容只有十条,但是我的习惯不好,没有尝试打log 看一下 条数 而是在自己推理。感谢大佬的指点!这个坏毛病得改一改。

    (鞠躬九十度)

    1535191548881276930  评论     打赏       二两仙气儿
    • item布局:

      <?xml version="1.0" encoding="utf-8"?>
      <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="match_parent"
          android:layout_height="75dp"
          android:background="#ffffff">
      
      
          <ImageView
              android:id="@+id/album_cover"
              android:layout_width="68dp"
              android:layout_height="65dp"
              android:layout_centerVertical="true"
              android:layout_marginLeft="5dp"
              android:background="@drawable/circular_bead"
              android:scaleType="fitXY" />
      
          <LinearLayout
              android:id="@+id/line1"
              android:layout_width="wrap_content"
              android:layout_height="match_parent"
              android:layout_marginLeft="10dp"
              android:layout_toRightOf="@id/album_cover"
              android:orientation="vertical">
      
              <TextView
                  android:id="@+id/album_title"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:ellipsize="end"
                  android:lines="1"
                  android:text="拿破仑·希尔《成功学全书》"
                  android:textColor="@color/black"
                  android:textSize="18sp" />
      
              <TextView
                  android:id="@+id/album_description_tv"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="3dp"
                  android:ellipsize="end"
                  android:lines="1"
                  android:text="拿破仑·希尔《成功学全书》"
                  android:textColor="#ff848484"
                  android:textSize="12sp" />
      
              <LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="10dp"
                  android:orientation="horizontal">
      
                  <LinearLayout
                      android:layout_width="wrap_content"
                      android:layout_height="match_parent"
                      android:layout_marginRight="2dp"
                      android:orientation="horizontal">
      
                      <ImageView
                          android:layout_width="6dp"
                          android:layout_height="6dp"
                          android:layout_gravity="center_vertical"
                          android:src="@mipmap/start" />
                  </LinearLayout>
      
                  <TextView
                      android:id="@+id/album_playcount"
                      android:layout_width="45dp"
                      android:layout_height="10dp"
                      android:text="234.5万"
                      android:textColor="#ff848484"
                      android:textSize="7sp" />
      
                  <LinearLayout
                      android:layout_width="wrap_content"
                      android:layout_height="match_parent"
                      android:layout_marginLeft="30dp"
                      android:orientation="horizontal">
      
                      <ImageView
                          android:layout_width="6dp"
                          android:layout_height="6dp"
                          android:layout_gravity="center_vertical"
                          android:src="@mipmap/dianzan" />
                  </LinearLayout>
      
                  <TextView
                      android:id="@+id/album_content_size"
                      android:layout_width="45dp"
                      android:layout_height="10dp"
                      android:layout_marginLeft="2dp"
                      android:text="23集"
                      android:textColor="#ff848484"
                      android:textSize="7sp" />
      
              </LinearLayout>
          </LinearLayout>
      
      
      </RelativeLayout> 
      


      1535191548881276930  评论     打赏       二两仙气儿
      • fragment布局:

        <?xml version="1.0" encoding="utf-8"?>
        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">
        
            <androidx.recyclerview.widget.RecyclerView
                android:overScrollMode="never"
                android:id="@+id/recommend_rvlist"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"/>
        
        </LinearLayout>
        
        1535191548881276930  评论     打赏       二两仙气儿
        • 拉大锯  回复 @二两仙气儿
          你是看漏视频了吗?没有刷新控件呢。
          拉大锯 2022-06-10 17:46   回复 1153952789488054272
      • 刷新的UI是由哪个控件完成的

        1153952789488054272  评论     打赏       拉大锯
        • 有用下拉刷新的控件吗

          1318000693470158848  评论     打赏       Decad
          相关问题
          拉大锯de · 喜马拉雅项目
          2020-08-18 04:20 508 2
          幻影~ · 提问
          2024-04-13 20:13 7 2
          幻影~ · 找工作
          2024-04-07 10:44 11 2
          幻影~ · 问题
          2024-03-31 17:20 7 2
          TONYGFX · AOSP
          2024-03-28 17:11 4 2