微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在 shimmerframelayout 中添加 3 个

如何解决如何在 shimmerframelayout 中添加 3 个

你好,我试图在 3 个 coulmn 的图像视图上添加微光效果,但问题是微光效果仅在一个 coulmn 中显示,而不在 3 个中显示

还有另一个问题,在我的一个物理设备中,即使设备规格非常好,微光效果看起来也卡住了,但在其他物理设备和模拟器上,微光动画显示平滑且有效

这是截图

enter image description here

XML 代码

Fragment_Profile.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.nestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/black"
    android:overScrollMode="never">


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:overScrollMode="never"
        android:paddingTop="20dp">

        <include
            android:id="@+id/snipet_profile"
            layout="@layout/snipet_profile" />

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/postRecyclerViewProfile"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:orientation="vertical"
            android:overScrollMode="never" />

        <com.facebook.shimmer.ShimmerFrameLayout
            android:id="@+id/shimmerEffect"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_gravity="center">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <include layout="@layout/post_item_container_shimmer" />

                <include layout="@layout/post_item_container_shimmer" />

                <include layout="@layout/post_item_container_shimmer" />

                <include layout="@layout/post_item_container_shimmer" />

                <include layout="@layout/post_item_container_shimmer" />

                <include layout="@layout/post_item_container_shimmer" />

                <include layout="@layout/post_item_container_shimmer" />

                <include layout="@layout/post_item_container_shimmer" />

                <include layout="@layout/post_item_container_shimmer" />

                <include layout="@layout/post_item_container_shimmer" />

            </LinearLayout>

        </com.facebook.shimmer.ShimmerFrameLayout>
    </LinearLayout>
</androidx.core.widget.nestedScrollView>

post_item_container_shimmer.xml

<RelativeLayout 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="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="1dp">


    <com.google.android.material.card.MaterialCardView
        android:layout_width="150dp"
        android:layout_height="150dp"
        android:layout_centerInParent="true"
        android:layout_marginStart="3dp"
        android:layout_marginTop="11dp"
        android:layout_marginEnd="3dp"
        app:cardElevation="1dp"
        app:cardMaxElevation="4dp"
        app:shapeAppearanceOverlay="@style/RoundedCorner"
        tools:ignore="ObsoleteLayoutParam">

        <com.google.android.material.imageview.ShapeableImageView
            android:id="@+id/imagePost"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:adjustViewBounds="true"
            android:background="#E7E7E7"
            android:contentDescription="@string/todo"
            app:shapeAppearanceOverlay="@style/RoundedCorner" />

    </com.google.android.material.card.MaterialCardView>
</RelativeLayout>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?