如何获取 ImageView 的图像级别?
在我的应用程序中,我使用一些带有 LevelListDrawables 的 Imageview 以便能够动态更改。
但现在我想知道我是否可以读取 ImageView 所声明的级别,我使用 setImageLevel() 设置级别,但没有反对悬挂方法来获取图像级别。
所以我的问题是:有没有办法获取图像视图的当前图像级别?
In my app I'm using a few Imageviews with LevelListDrawables to be able to change then dynamically.
But now I want to know if I can read in which level the ImageView is stated, I set the level with setImageLevel() but there is no against hanging method to get the imagelevel.
So my question is: Is there a way to get the current imagelevel of an imageview?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你不能直接对 ImageView 执行此操作,但你可以这样做
,这将达到目的,有关详细信息,请参阅 Drawable#getLevel()
You can't do it directly to the ImageView, but you can do this
That will do the trick, for further information the offical documentation for Drawable#getLevel()