【问题标题】:.measure function doesn't work on android (React Native).measure 函数不适用于 android (React Native)
【发布时间】:2022-11-22 07:55:44
【问题描述】:

我使用本机反应。在 iOS 上,该函数运行良好并返回值。在 android 上,它为所有参数返回 undefined。

activeCategoryRef.current?.measure((fx, fy, width, height, px) => {
  console.log(width)
  console.log(px);
  scrollTo(px - width);
});

【问题讨论】:

    标签: android ios react-native


    【解决方案1】:

    必须添加:

    collapsable={false}
    

    到被测量的组件。

    【讨论】:

      猜你喜欢
      • 2021-09-05
      • 2020-03-25
      • 2017-06-08
      • 2022-01-11
      • 2021-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多