当前位置:网站首页>RecyclerView最后一条显示不全或显示部分的问题解决
RecyclerView最后一条显示不全或显示部分的问题解决
2022-07-26 10:14:00 【FrancisBingo】
一、问题现象
RecyclerView最后一条数据展示不全的问题
二、前提条件
使用ViewPager+Fragment+RefreshLayout+RecyclerView+constrainLayout
三、尝试解决方式
什么叫尝试解决方式,就是使用了以下方式,各种修改各种没解决。
1.recyclerview高度设置为0dp,然后添加app:layout_constraintBottom_toBottomOf="parent"
2.recyclerview用NestedScrollView包起来
3.recyclerview外套RelativeLayout
如果以上尝试都没有解决你的问题、那么好,接下来就是见证奇迹的时刻了。
四、最终解决方案
使用CoordinatorLayout+AppBarLayout修饰viewPager完美解决~话不多说半句多。请看代码
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/sv_contentView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/common_content_background_color">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/ll_contentView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:elevation="0dp">
<ai.gmtech.uicom.ui.CommonTitleBar
android:id="@+id/commonTitleBar26"
android:layout_width="match_parent"
android:layout_height="44dp"
app:title="对讲">
</ai.gmtech.uicom.ui.CommonTitleBar>
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_call"
android:layout_width="match_parent"
android:layout_height="44dp"
android:background="@color/white_FFFFFFFF"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tabIndicator="@drawable/tab_indictor_bg"
app:tabIndicatorColor="@color/common_tv_font_color">
</com.google.android.material.tabs.TabLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/bottom_view_cl"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<RelativeLayout
android:id="@+id/view_pager_rl"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_weight="1">
<androidx.viewpager.widget.ViewPager
android:id="@+id/callpage_viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.viewpager.widget.ViewPager>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>五、若有其他问题及及解决方案欢迎留言探讨
边栏推荐
- Azkaban [basic knowledge 01] core concepts + features +web interface + Architecture +job type (you can get started with Azkaban workflow scheduling system in one article)
- [information system project manager] summary of essence of high-level series for the first time
- Vs Code configures go locale and successfully installs go related plug-ins in vscode problem: Tools failed to install
- [MySQL database] a collection of basic MySQL operations - the basis of seeing (adding, deleting, modifying, and querying)
- I finished watching this video on my knees at station B
- Study notes of the second week of sophomore year
- Interpretation of the standard of software programming level examination for teenagers_ second level
- Uniapp "no mobile phone or simulator detected, please try again later" and uniapp custom components and communication
- 万字详解“用知识图谱驱动企业业绩增长”
- Show default image when wechat applet image cannot be displayed
猜你喜欢

论文笔记(SESSION-BASED RECOMMENDATIONS WITHRECURRENT NEURAL NETWORKS)

El table implements adding / deleting rows, and a parameter changes accordingly

Study on the basis of opencv

服务发现原理分析与源码解读

Data communication foundation TCPIP reference model

Spolicy request case

Data communication foundation telnet remote management equipment

Principle analysis and source code interpretation of service discovery
![Sqoop [environment setup 01] CentOS Linux release 7.5 installation configuration sqoop-1.4.7 resolve warnings and verify (attach sqoop 1 + sqoop 2 Latest installation package +mysql driver package res](/img/8e/265af6b20f79b21c3eadcd70cfbdf7.png)
Sqoop [environment setup 01] CentOS Linux release 7.5 installation configuration sqoop-1.4.7 resolve warnings and verify (attach sqoop 1 + sqoop 2 Latest installation package +mysql driver package res

Meeting OA project (III) -- my meeting (meeting seating and submission for approval)
随机推荐
AR model in MATLAB for short-term traffic flow prediction
万字详解“用知识图谱驱动企业业绩增长”
Rowselection emptying in a-table
Uniapp error 7 < Map >: marker ID should be a number
数通基础-网络基础知识
分布式网络通信框架:本地服务怎么发布成RPC服务
On the compilation of student management system of C language course (simple version)
Why does new public chain Aptos meet market expectations?
PHP executes shell script
Okaleido生态核心权益OKA,尽在聚变Mining模式
Wechat applet learning notes 2
汉诺塔II|汉诺塔4柱
数通基础-二层交换原理
Data communication foundation TCPIP reference model
Learning about opencv (3)
网易云UI模仿--&gt;侧边栏
[Qualcomm][Network] qti服务分析
IE7 set overflow attribute failure solution
服务发现原理分析与源码解读
Study on the basis of opencv