set zoom level programmatically
- Dominant language
- Java
- Stars
- 18.8k
- Forks
- 3.9k
- PR merge metrics
- No merged PRs in 30d
Description
i try [this](https://github.com/chrisbanes/PhotoView/issues/557)solution but it didn't work for me
```
val img: PhotoView = PhotoView(container.context)
Glide.with(container.context)
.load(if (images[position].isNullOrBlank()) "error" else images[position])
.into(img)
val vto: ViewTreeObserver = img.getViewTreeObserver()
vto.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener {
override fun onGlobalLayout() {
img.getViewTreeObserver().removeOnGlobalLayoutListener(this)
img.setScale(2f)
}
})
val layout = img
container.addView(layout)
```
Contributor guide
Assessment
This issue has not been assessed yet.