Skip to content

OCNYang/AnchorImageViewDemo

Repository files navigation

Anchor point picture

 Sketch Map

Implemented functions

  • Set anchor points for pictures according to anchor point coordinates
  • Anchor has click event
  • The picture can be zoomed in and out and moved, and the relative position of anchor point remains unchanged

Demo Effect

 Demo Effect

usage method

1. Introduction

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

 allprojects { repositories { ... maven { url ' https://jitpack.io ' } } }

Step 2. Add the dependency Version Code

 dependencies { implementation 'com.github.OCNYang:AnchorImageViewDemo:v1.3' }

2. Specific usage

Please refer to the Demo source code

No display of loaded pictures

  1. Create an xml folder under the res folder, and then create a network_security_config.xml file with the following contents:

    It has been provided in the library and can be used directly

     <? xml version="1.0" encoding="utf-8"?> <network-security-config> <base-config cleartextTrafficPermitted="true" /> </network-security-config>
  2. Next, add the following attributes to the application tag under the AndroidManifest.xml file:

     <application ... android:networkSecurityConfig="@xml/network_security_config" ... />