相关疑难解决方法(0)

反应原生的请求孤立的任务 - 这是什么意思?

我正在尝试使用按钮和其他操作为瓷砖构建网格系统.我试着使用本机操场网格图像源,你可以在这里找到.添加zIndex到单个图片时,它会产生以下"堆栈跟踪"和错误.永远不会描绘图像.

在此输入图像描述

如果您感兴趣,这是我正在使用的确切组件:

export default class GridLayout extends Component {
  constructor () {
    super()
    const { width, height } = Dimensions.get('window')
    this.state = {
      currentScreenWidth: width,
      currentScreenHeight: height
    }
  }

  handleRotation (event) {
    var layout = event.nativeEvent.layout
    this.setState({ currentScreenWidth: layout.width, currentScreenHeight: layout.height })
  }

  calculatedSize () {
    var size = this.state.currentScreenWidth / IMAGES_PER_ROW
    return { width: size, height: size }
  }

  renderRow (images) {
    return images.map((uri, i) => {
      return (
        <Image key={i} style={[styles.image, this.calculatedSize()]} source={{uri: uri}} …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs react-native

13
推荐指数
2
解决办法
1万
查看次数

标签 统计

javascript ×1

react-native ×1

reactjs ×1