【问题标题】:React Native - Expected argument type 'RCTViewManagerUIBlockReact Native - 预期的参数类型'RCTViewManagerUIBlock
【发布时间】:2017-02-15 12:28:16
【问题描述】:

我们想使用react-native-sprite 在我们的应用程序中为一些 png 序列设置动画。不幸的是,我们在构建应用程序时遇到了以下错误:

无法将类型 '(RCTUIManager!, [NSNumber : UIView]!) -> ()' 的值转换为预期的参数类型 'RCTViewManagerUIBlock!'

以下代码抛出错误:

// Let's start with some spaghetti to get a view!
self.bridge!.uiManager.addUIBlock { (uiManager: RCTUIManager!, viewRegistry:[NSNumber : UIView]!) in
  let view: Sprite = viewRegistry[reactTag] as! Sprite;

  // The first parameter is not named, but the second one requires a name. Whatever!
  view.createSequence( nameWithPath, count:count, format:format, duration:duration );
}

我对 react-native Objective-c 库不太熟悉。

【问题讨论】:

    标签: ios objective-c swift reactjs react-native


    【解决方案1】:

    A fix 现在在仓库中。希望这对你有用。

    旁注:这个组件是相当实验性的,边缘粗糙。如果您在生产中使用它,请在整个过程中对其进行测试。例如,较大的图像序列在旧手机中加载或使应用程序崩溃可能会很慢。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-03-05
      • 2022-08-24
      • 2019-08-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多