android – 在RelativeLayout内部移动ImageView

android – 在RelativeLayout内部移动ImageView,第1张

概述我需要在RelativeLayout内部移动 ImageView(或其他任何东西).有没有人知道这样做的正确方法? Menseure ImageView的layout_height和layout_width设置为fill_parent.然后做: 要移动视图,请使用Matrix.这非常方便. Matrix matrix = new Matrix();matrix.reset();matrix 我需要在relativeLayout内部移动 ImageVIEw(或其他任何东西).有没有人知道这样做的正确方法?解决方法 Menseure ImageVIEw的layout_height和layout_wIDth设置为fill_parent.然后做:

要移动视图,请使用Matrix.这非常方便.

Matrix matrix = new Matrix();matrix.reset();matrix.postTranslate(x,y);imagevIEw.setScaleType(ScaleType.MATRIX);imagevIEw.setimageMatrix(matrix);
总结

以上是内存溢出为你收集整理的android – 在RelativeLayout内部移动ImageView全部内容,希望文章能够帮你解决android – 在RelativeLayout内部移动ImageView所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1136659.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-30
下一篇2022-05-30

发表评论

登录后才能评论

评论列表(0条)

    保存