【发布时间】:2018-10-30 17:00:17
【问题描述】:
这是我的 XML 代码
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".ImageViewer">
<android.support.design.widget.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#32000000">
<android.support.v7.widget.Toolbar
android:id="@+id/tabLayout"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</android.support.design.widget.AppBarLayout>
<!-- The primary full-screen view. This can be replaced with whatever view
is needed to present your content, e.g. VideoView, SurfaceView,
TextureView, etc. -->
<com.github.chrisbanes.photoview.PhotoView
android:id="@+id/Zoomage_Image"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
这是我的 Java 代码
ImageView zoomage=findViewById(R.id.Zoomage_Image);
Intent i=getIntent();
String imageuri=i.getStringExtra("imageurl");
Log.d(TAG, "onCreate: "+imageuri);
Picasso.get().load(Uri.parse(imageuri)).into(zoomage);
放大效果非常好,但是每当我缩小图像时,屏幕上都会留下难看的拖曳效果如何使这些拖曳痕迹消失而不显示。
在某些设备上,此拖出不显示,而在某些设备上,这看起来很丑陋。
截图
当您使用它时,还可以帮助我添加应用栏布局,使其成为半透明,并在单击后退按钮时提供向上导航。
【问题讨论】:
-
@Ramees 不,我认为该代码的作者不知道他在做什么,例如:
view.animate().rotationBy(angle).setDuration(0)- 为什么要使用ViewPropertyAnimator?这是使用ViewPropertyAnimator、直接设置属性(如setScaleX)和设置布局参数的糟糕组合 -
我的回答解决了你的问题吗?
-
我很困惑。如何实现你的方式?
标签: java android xml user-interface user-experience