android-如何逐渐隐藏recyclerview滚动条上的项目

android-如何逐渐隐藏recyclerview滚动条上的项目,第1张

概述我如何逐渐在Recyclerview滚动条隐藏项目我想要这样的图像工具列<?xmlversion="1.0"encoding="utf-8"?><android.support.v7.widget.Toolbarxmlns:android="http://schemas.android.com/apkes/android"xmlns:app="http://schemas.androi

我如何逐渐在RecyclervIEw滚动条上隐藏项目

我想要这样的图像

工具列

<?xml version="1.0" enCoding="utf-8"?><androID.support.v7.Widget.Toolbar xmlns:androID="http://schemas.androID.com/apk/res/androID"    xmlns:app="http://schemas.androID.com/apk/res-auto"    androID:ID="@+ID/toolbar"    androID:layout_wIDth="match_parent"    androID:layout_height="55dp"    androID:background="@color/posts_toolbar"    app:contentInsetleft="0dp"    app:contentInsetStart="0dp">    <com.salah250.forvo.Funcations.TextVIEwFont        androID:ID="@+ID/txt_Title"        androID:layout_wIDth="match_parent"        androID:layout_height="wrap_content"        androID:gravity="center"        androID:text="@string/posts_Title"        androID:textcolor="@color/posts_Title"        androID:textSize="18dp" /></androID.support.v7.Widget.Toolbar>

活动帖子

<?xml version="1.0" enCoding="utf-8"?><linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"    xmlns:app="http://schemas.androID.com/apk/res-auto"    xmlns:tools="http://schemas.androID.com/tools"    androID:layout_wIDth="match_parent"    androID:layout_height="match_parent"    androID:background="@color/posts_main"    androID:orIEntation="vertical"    tools:context=".posts.postsActivity">    <include layout="@layout/toolbar_posts" />    <androID.support.v7.Widget.RecyclerVIEw        androID:ID="@+ID/rv_posts"        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent"        androID:overScrollMode="never" /></linearLayout>

我看了看之后才可以在这里发布,而且根本找不到任何有关它的话题,我希望从中获得一些想法.

解决方法:

您可以将渐变图像放在RecyclerVIEw的前面

<?xml version="1.0" enCoding="utf-8"?><linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"    xmlns:app="http://schemas.androID.com/apk/res-auto"    xmlns:tools="http://schemas.androID.com/tools"    androID:layout_wIDth="match_parent"    androID:layout_height="match_parent"    androID:background="@color/posts_main"    androID:orIEntation="vertical"    tools:context=".posts.postsActivity">    <include layout="@layout/toolbar_posts" />    <FrameLayout        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent">            <androID.support.v7.Widget.RecyclerVIEw                androID:ID="@+ID/rv_posts"                androID:layout_wIDth="match_parent"                androID:layout_height="match_parent"                androID:overScrollMode="never" />            <ImageVIEw                androID:layout_wIDth="match_parent"                androID:layout_height="40dp"                androID:src="@drawable/gradIEnt"/>    <FrameLayout/>            </linearLayout>

@ drawable / gradIEnt.xml

<?xml version="1.0" enCoding="utf-8"?><shape xmlns:androID="http://schemas.androID.com/apk/res/androID"       androID:shape="rectangle" >    <gradIEnt    androID:angle="270"    androID:endcolor="#00FFFFFF"    androID:startcolor="#302e43" /></shape>

然后,将带有渐变高度的空视图添加到RecyclerVIEw的标题中,以使最上面的项目不褪色

总结

以上是内存溢出为你收集整理的android-如何逐渐隐藏recyclerview滚动条上的项目全部内容,希望文章能够帮你解决android-如何逐渐隐藏recyclerview滚动条上的项目所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1082011.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-27
下一篇2022-05-27

发表评论

登录后才能评论

评论列表(0条)

    保存