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