IT/안드로이드+JAVA

[안드로이드] 이미지뷰 핀치줌, 확대, 축소

안경 쓴 귀니 2016. 10. 4. 10:57
반응형




[안드로이드] 이미지뷰 핀치줌, 확대, 축소







1. build.gradle (Project: project명)


allprojects{} 안에 repositories {}에 maven { url "https://jitpack.io" }  추가

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




2. build.gradle (Module: app)


dependencies{}에 compile 'com.github.chrisbanes:PhotoView:1.3.0' 추가

compile 'com.github.chrisbanes:PhotoView:1.3.0'




3. Activity 에서 적용하기


PhotoViewAttacher attacher;

ImageView iv = (ImageView)findViewById(R.id.iv);

attacher = new PhotoViewAttacher(iv);

PhotoViewAttacher attacher;
ImageView iv = (ImageView)findViewById(R.id.iv);
attacher = new PhotoViewAttacher(iv);




적용 끝!!!!!!



[출처 : https://github.com/chrisbanes/PhotoView ]

반응형