一、下载地址:https://github.com/chrisbanes/PhotoView

点击DownLoad ZIP,进行下载。

使用开源库PhotoView

二、解压,然后复制PhotoView-master\library\src\main\java目录下的uk文件夹,用于复制到新建的项目中

参考:http://www.th7.cn/Program/Android/201410/304371.shtml

使用开源库PhotoView

使用开源库PhotoView

三、解决“'<>' operator is not allowed for source level below 1.7”的问题

使用开源库PhotoView

参考:http://blog.csdn.net/sam_jet/article/details/45744251

解决方法:

右键项目--属性--JAVA Compiler--勾选Enable project  specific  settings--Compiler compliance level--选择1.7--OK.

使用开源库PhotoView

使用开源库PhotoView

使用开源库PhotoView

四、简单使用

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>
activity_main

相关文章:

  • 2021-08-06
  • 2021-08-08
  • 2022-12-23
  • 2022-12-23
  • 2023-04-06
  • 2021-12-10
猜你喜欢
  • 2021-09-29
  • 2021-10-15
  • 2022-12-23
  • 2021-09-09
  • 2022-01-19
  • 2022-12-23
  • 2021-08-24
相关资源
相似解决方案