0

我使用 volley networkimageview 加载图像。以下是我的布局文件

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/white">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="#3dd2c6"
        app:layout_scrollFlags="scroll|enterAlways"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

    <com.android.volley.toolbox.NetworkImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="10dp"
        android:layout_marginBottom="10dp"
        android:id="@+id/zoomImg"/>
</LinearLayout>

以下是我用来将图像加载到 NetworkImageView 的代码。

 NetworkImageView zoomImage = (NetworkImageView) findViewById(R.id.zoomImg);
SharedPreferences prefs = getApplicationContext().getSharedPreferences("private",
                PreferenceActivity.MODE_PRIVATE);
        String image = prefs.getString("imgUrl", null);
        zoomImage.setImageUrl(image, imageLoader);

如何为networkimageview设置捏合和缩放功能?

4

1 回答 1

0

我创建了一个自定义图像视图,带有捏合和缩放以及凌空的网络图像视图。请查看此链接 - https://gist.github.com/vkrm26/a21b5cca5d928485c4bc910a835e0003

让我知道是否有任何问题。

于 2016-06-06T08:29:57.473 回答