一、下载地址:https://github.com/chrisbanes/PhotoView
点击DownLoad ZIP,进行下载。
二、解压,然后复制PhotoView-master\library\src\main\java目录下的uk文件夹,用于复制到新建的项目中
参考:http://www.th7.cn/Program/Android/201410/304371.shtml
三、解决“'<>' operator is not allowed for source level below 1.7”的问题
参考:http://blog.csdn.net/sam_jet/article/details/45744251
解决方法:
右键项目--属性--JAVA Compiler--勾选Enable project specific settings--Compiler compliance level--选择1.7--OK.
四、简单使用
1、在布局文件中含有一个imageview控件。
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:orientation="vertical" > <ImageView android:id="@+id/mImageView" android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/wallpaper" android:contentDescription="@string/app_name" /> </LinearLayout>