小编Mah*_*our的帖子

在React Native Render Text组件中显示动画值

我无法在“渲染”上显示“动画值”并返回此错误。

永久违反:对象作为React子对象无效(找到:具有键{value}的对象)。如果要渲染子级集合,请改用数组。

当然,我看到了 console

constructor(props) {
    super(props);

    this.state={
       progress:0
    }

    this.animatedValue = new Animated.Value(0);

    this.animatedValue.addListener((progress) => {
        this.setState({progress})
    });
}

componentDidMount() {
    this.animate()
}

animate() {
    this.animatedValue.setValue(0);
    Animated.timing(
        this.animatedValue,
        {
            toValue: 1,
            duration: 15000,
            easing: Easing.linear
        }
    ).start()
}

render() {
    return(
        <View>
            <Text> {this.state.progress} </Text>
        </View>
    );

}
Run Code Online (Sandbox Code Playgroud)

javascript reactjs react-native

3
推荐指数
1
解决办法
1506
查看次数

当我们到达列表的底部时,React Native FlatList加载更多

如何使用React Native的FlatList (非无限)进行更多加载

我已经做到了这一点,但不幸的是它无限加载.

这是我的代码片段

<FlatList
    data={this.props.data}
    renderItem={({ item, separators }) => (
        <TouchableHighlight
            onPress={() => this._onPress(item)}
            onShowUnderlay={separators.highlight}
            onHideUnderlay={separators.unhighlight}
        >
            <Text> {item.title} </Text>
        </TouchableHighlight>
    )}
    keyExtractor={item => item.id}
    ListFooterComponent={this.renderFooter}
    onEndReached={this.props.handleLoadMore}
    onEndThreshold={0}
/>
Run Code Online (Sandbox Code Playgroud)

而我的handleLoadMore

handleLoadMore = () => {
    console.log("test"); // <---- this line run infinitely
    fetch(url, {
        method: "POST",
        headers: {
            Accept: "application/json",
            "Content-Type": "application/json"
        },
        body: JSON.stringify(filters)
    })
        .then(response => response.json())
        .then(responseJson => {
            this.setState({
                itemData: [
                    ...this.state.itemData,
                    ...responseJson.estate_list
                ],
                itemPage: this.state.itemPage + 1
            });
        })
        .catch(error => …
Run Code Online (Sandbox Code Playgroud)

react-native react-native-flatlist

3
推荐指数
1
解决办法
4711
查看次数

如何在 Markdown 中编写 RTL 方向

如何在 Markdown 文件中编写 RTL 方向?

例如:

#?????

* ????? ??
* ????? ??
* ????? ??
Run Code Online (Sandbox Code Playgroud)

markdown right-to-left

3
推荐指数
1
解决办法
430
查看次数

React Native:此版本不符合 Google Play 64 位要求

当我发表我的文章时React Native AppGoogle Play我收到了这个错误:

此版本不符合 Google Play 64 位要求

以下 APK 或 App Bundle 可用于 64 位设备,但它们只有 32 位本机代码:9 和 24。

在您的应用中包含 64 位和 32 位本机代码。使用 Android App Bundle 发布格式自动确保每个设备架构只接收它需要的原生代码。这可以避免增加应用程序的整体大小。

在此处输入图片说明

我该如何解决这个错误?

android google-play react-native react-native-android

3
推荐指数
1
解决办法
2926
查看次数

类型org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler类型的对象的未知属性'supportLibVersion'

我收到以下错误

无法获得类型为org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHand的对象的未知属性'supportLibVersion'

我正在开发本机应用程序,并且本机映射依赖项在下面出现错误

 dependencies {
      def supportLibMajorVersion = supportLibVersion.split('\\.')[0] as int
      def appCompatLibName =  (supportLibMajorVersion < 20) ? "androidx.appcompat:appcompat" : "com.android.support:appcompat-v7"
      implementation "$appCompatLibName:$supportLibVersion"
      implementation('com.facebook.react:react-native:+') {
        exclude group: 'com.android.support'
      }
      implementation "com.google.android.gms:play-services-base:${safeExtGet('playServicesVersion', '16.1.0')}"
      implementation "com.google.android.gms:play-services-maps:${safeExtGet('playServicesVersion', '16.1.0')}"
      implementation 'com.google.maps.android:android-maps-utils:0.5'
    }
Run Code Online (Sandbox Code Playgroud)

谁能知道这是怎么回事?

终端中的错误是

失败:构建失败,发生异常。

其中:
构建文件'D:\ react native \ abhishek \ Gwala \ node_modules \ react-native-maps \ lib \ android \ build.gradle'行:20

出了什么问题:
评估项目':react-native-maps'时发生问题。
无法获得类型为org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler的对象的未知属性'supportLibVersion'。

第20行是

def supportLibMajorVersion = supportLibVersion.split('\\.')[0] as int
Run Code Online (Sandbox Code Playgroud)

react-native react-native-android react-native-maps

3
推荐指数
2
解决办法
1926
查看次数

“composer 更新”和“composer 升级”有什么区别?

我知道“安装”和“更新”之间的区别,但我找不到composer update和之间的区别composer upgrade

php package-managers dependency-management composer-php

3
推荐指数
1
解决办法
741
查看次数

在 React Native Animated 中使用 useNativeDriver 时出错

当我useNativeDriver在 React Native Animated 中使用时

state = {
    chevronUp: new Animated.Value(-50),
};

Animated.spring(this.state.chevronUp, {
    toValue: 50,
    friction: 5,
    useNativeDriver: true,  // <----- this line
}).start();
Run Code Online (Sandbox Code Playgroud)

并渲染

<Animated.View style={{bottom: this.state.chevronUp,position: "absolute", right: 20, width: 50, height: 50}}>
     <Icon name="chevron-up" size={28} color="#666"/>
</Animated.View>
Run Code Online (Sandbox Code Playgroud)

这些错误给了我

原生动画模块不支持样式属性“底部”

无法在未安装的组件上调用 setState(或 forceUpdate)。这是一个空操作,但它表明您的应用程序中存在内存泄漏。要修复,请取消 componentWillUnmount 方法中的所有订阅和异步任务。

animation react-native react-animated

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

在React Native中使用requestAnimationFrame

如何在native native中使用requestAnimationFrame.

我用它来表现这样的TouchableOpacity

this.requestAnimationFrame(() => {
    if (this.state.scrollEnabled)
        this._panel.transitionTo({toValue: 0});
    else {
        this.setState({scrollEnabled: true}, () => {
            this._panel.transitionTo({toValue: height})
        })
    }
});
Run Code Online (Sandbox Code Playgroud)

并返回此错误

this.requestAnimationFrame不是一个函数

react-native

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

如何在本地主机中为 XAMPP 创建有效的 SSL

如何使用安全连接(SSL我)XAMPP

打开本地主机页面时出现以下错误:

连接不安全

php windows apache xampp ssl

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

如何在 PHP 中使用“Nullsafe 运算符”

有没有办法在php中使用Nullsafe operator条件?

php php-8

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