android - 来自视图寻呼机共享元素的图像视图错误退出过渡
问题描述
我正在尝试制作一个流畅而漂亮的动画,但我遇到了这个问题:
第一个 imageView 屏幕有 scaleType="centerCrop" 我认为这是问题所在。修复退出动画缩放的任何解决方案?
我使用以下代码打开 fullScreenActivity:
imageView.setOnClickListener(view1 -> {
ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation((Activity) context, view1, "itemImageTransition");
startActivity(new Intent(context, FullScreenImageActivity.class), options.toBundle());
});
和 viewpager 布局是
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:transitionName="itemImageTransition" />
全屏布局是
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<it.tcconsulting.cyclone.utils.TouchImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:transitionName="itemImageTransition" />
解决方案
推荐阅读
- heroku - 找不到该进程类型(网络)
- java - 为什么字节到字符的转换需要int加宽转换
- c - 为什么我的 scanf 不能正常工作,当我移动它时,它工作正常?
- python-3.x - 如何从python中的多次重定向url中获取目标url?
- javascript - 如何在“新”中少写
- android - DELETE 调用返回 415 不支持的媒体类型
- java - 在我的数据库 Java Derby 中插入新数据时生成的 ID 错误
- javascript - Brain.js GPU 慢速训练
- selenium - Selenium Webdriver Java-> 单击我想要的帖子的 Facebook 分享按钮
- java - 通过更新变量更改 LiveData 源