如何解决如何在 shimmerframelayout 中添加 3 个
你好,我试图在 3 个 coulmn 的图像视图上添加微光效果,但问题是微光效果仅在一个 coulmn 中显示,而不在 3 个中显示
还有另一个问题,在我的一个物理设备中,即使设备规格非常好,微光效果看起来也卡住了,但在其他物理设备和模拟器上,微光动画显示平滑且有效
这是截图
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 举报,一经查实,本站将立刻删除。