如何解决android缩放图像并滑动以更改
基本上,我正在尝试使用 Frisco 库缩放图像,并且还想在缩放为 100% 时左右滑动以更改图像。
我获得了使用 Frisco 和 PhotoDraweeView 查看和缩放图像的第一部分,但无法弄清楚如何滑动以更改图像。
到目前为止我的代码 -
布局 -
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fresco="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:background="@color/cardview_dark_background"
>
<me.relex.photodraweeview.PhotoDraweeView
android:id="@+id/my_image_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
fresco:placeholderImage="@drawable/notification_nvoids"
/>
</LinearLayout>
Java 活动文件 -
import me.relex.photodraweeview.PhotoDraweeView;
import java.io.File;
public class FrescoActivity extends AppCompatActivity {
@Override
protected void onCreate( Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.zoomlayout);
String image = getIntent().getStringExtra("image");
File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/" + image);
Uri uri = Uri.fromFile(file);
PhotoDraweeView draweeView = (PhotoDraweeView) findViewById(R.id.my_image_view);
draweeView.setPhotoUri(uri);
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。