【问题标题】:What is the alternative method in HarmonyOS for imageview.getImageMatrix( ) in AndroidOSAndroidOS中imageview.getImageMatrix()在HarmonyOS中的替代方法是什么
【发布时间】:2021-07-30 07:53:15
【问题描述】:

在 Android 中,我们将在 imageView 上使用 getImageMatrix( ) 方法,该方法返回视图的可选矩阵。这在绘制时应用于视图的可绘制对象。如果没有矩阵,此方法将返回一个单位矩阵。
在安卓中:

Matrix matrix = imageView.getImageMatrix( ).

在 HarmonyOS 中这个代码 sn-p 的替代方法是什么?

【问题讨论】:

  • 由于 HarmonyOS 声称它与 Android 没有关系并且是从头开始编写的,因此应该没有替代 getImageMatrix() 的方法。而且应该没有替代 imageView 的方法。

标签: java android huawei-mobile-services huawei-developers harmonyos


【解决方案1】:

正如@AIMIN 所指出的,目前Harmony 没有ImageView.getImageMatrix() 的确切替代方案。

但我们将能够为 Image 组件计算 getImageMatrix()。参考这个 PhotoView 实现

https://gitee.com/openharmony-tpc/PhotoView/blob/master/library/src/main/java/com/github/chrisbanes/photoview/PhotoView.java

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多