android缩放图像并滑动以进行更改

6fe3ivhb  于 2021-08-20  发布在  Java
关注(0)|答案(0)|浏览(224)

基本上,我正在尝试使用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);

}
}

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题