imageview.setImageMatrix 不改变图像
我正在更改图像矩阵(缩放和拖动)并调用 imageview.setImageMatrix(matrix) 但图像不会更改。
我没有忘记设置:
android:scaleType="矩阵"
xml 文件中的
。我检查了日志,触摸事件被正确拦截+矩阵本身被正确计算。
但仍然...对屏幕上的图像没有影响...
有人遇到过这种奇怪的行为吗?
I am changing the image matrix (zooming and dragging) and calling imageview.setImageMatrix(matrix) but the image won't change.
I didn't forget to set:
android:scaleType="matrix"
in the xml file.
I checked the Log and the touch events are intercepted correctly + the matrix itself is calculated correctly.
but still... no effect on the image on screen....
Did anyone encounter this strange behavior?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这篇文章可能会帮助您为什么 ImageView.setImageMatrix() 不起作用?
并记住(来自文档)Matrix 没有构造函数,因此必须使用 reset() 显式初始化它 - 构造单位矩阵,或 set..() 函数之一(例如 setTranslate、setRotate、等)。
This post might help you Why does ImageView.setImageMatrix() not work?
and remember (from doc) Matrix does not have a constructor, so it must be explicitly initialized using either reset() - to construct an identity matrix, or one of the set..() functions (e.g. setTranslate, setRotate, etc.).