https://github.com/Baseflow/PhotoView
GitHub - Baseflow/PhotoView: Implementation of ImageView for Android that supports zooming, by various touch gestures.
Implementation of ImageView for Android that supports zooming, by various touch gestures. - GitHub - Baseflow/PhotoView: Implementation of ImageView for Android that supports zooming, by various to...
github.com
이 분의 라이브러리로 이미지를 확대/축소 할 수 있다. (PhotoView라이브러리 사용)
사용법
1. gradle에 코드 추가
module build.gradle이 아니라 root build.gradle에 추가해줘야한다.
이때 root build.gradle이 뭔지 몰라서 헤맸었다
settings.gradle에 들어가서
같은 코드를 두 번 추가해준다.
2. module build.gradle에 다음 코드를 추가해준다.
이때, 코드 맨 끝에 있는 latest.release.here은 지우고 깃허브에 있는 라이브러리의 최신 버전을 넣어야한다.
버전은 이 글 위에 있는 깃허브 링크에 들어가면 README.md 파일 윗부분에 있다.
module build.grade의 dependencies에 추가한다.
3. 마지막으로, XML파일에서 photoview를 쳐서 자동완성 시키는 태그를 넣어주면 된다.
'Android' 카테고리의 다른 글
[Android] CardView 위에 ImageView 걸치기 (1) | 2023.01.19 |
---|---|
[Android] 원형 이미지뷰 / CircleImageView 만들기 (0) | 2023.01.03 |
[Android] 프로젝트 위에 있는 Action bar 바꾸기 (0) | 2023.01.03 |
[Android] TextView background를 Xml로 지정 (0) | 2023.01.02 |
[Android] TabLayout text color, indicator color 변경 (2) | 2023.01.02 |