react native FaltList 页面内容实时刷新

    // 选择头像
    _image(item){
        ImagePicker.showImagePicker(options,(response) => {
            if(response.didCancel){
                this.refs.toast.show('取消成功',500)
            }
            else if(response.error){
                this.refs.toast.show(`response.error)`,500)
            }
            else if(response.customButton){
                this.refs.toast.show('自定义按钮点击:' + response.customButton,500)
            }
            else{
                let source = { uri: 'data:image/jpeg;base64,' + response.data };
                item.image = source.uri;
                this.setState({data: this.state.data})
            }
        })
    }

extraData={this.state}           必须添加

每次修改之后,将 this.state.data 重新更新一次,即可

猜你喜欢

转载自blog.csdn.net/qq_39910762/article/details/82800939