【问题标题】:Pinch and Zoom to network image view捏合和缩放到网络图像视图
【发布时间】:2016-10-05 18:26:35
【问题描述】:

我正在使用 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 设置捏合和缩放功能?

【问题讨论】:

    标签: android android-volley networkimageview


    【解决方案1】:

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

    如果有任何问题,请告诉我。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-24
      • 1970-01-01
      • 2012-10-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多