小编lan*_*rew的帖子

反应本机博览会。Android 深色模式问题

当我将移动主题从浅色更改为深色时,它会影响我的反应本机应用程序的背景颜色。我只是希望它始终保持白色,但当我将移动主题从浅色更改为深色时,它会从白色变为黑色。我找到了 React Native without Expo: React Native android dark mode issues的解决方案,但我无法使用它,因为我没有Android文件夹。

react-native expo

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

React Native Reanimated 2 冲突 FlatList 和 PanGestureHandler

我正在尝试创建具有滑动删除功能的垂直平面列表。因此,我的平面列表的每个项目均由PanGestureHandler我的问题是当我尝试滚动时,由于滚动视图动画与平移手势动画之间的冲突,我的平面列表滚动不起作用。我尝试过使用simultaneousHandlers但没有帮助。我也尝试使用FlatListfromreact-native-gesture-handler和 fromreact-native结果是一样的。

<View style={styles.container}>
            <Header data={{headerText: 'Contacts', leftIcon: 'arrow-left', line: true}}/>
            <FlatList
                ref={scrollRef}
                data={contacts}
                renderItem={({item}) => <Item simultaneousHandlers={scrollRef} {...{item}} />}
                bounces={false}
                showsVerticalScrollIndicator={false}
                style={{paddingLeft: wp('5%'), paddingTop: hp('2%')}}>
            </FlatList>
            <TouchableOpacity style={styles.touchableOpacity} onPress={() => navigation.navigate('AddContact')}>
                <View>
                    <Text style={styles.textButton}> Add Contact </Text>
                </View>
            </TouchableOpacity>
        </View>
Run Code Online (Sandbox Code Playgroud)

物品:

<Animated.View style={[rTaskContainerStyle]}>
                    <Animated.View style={[styles.iconContainer, rIconContainerStyle]}>
                        <Icon name={'trash-2'} size={25} color={'red'} />
                    </Animated.View>
                    <View>
                    <PanGestureHandler {...simultaneousHandlers} onGestureEvent={panGestureHandler}>
                        <Animated.View style={[rStyle,{backgroundColor: '#FFFFFF'}]}>
                            <Text style={{color: '#09101D', fontFamily: 'SourceSansPro_600SemiBold', fontSize: 18}}>
                                {info.fullName}
                            </Text>
                            <Text …
Run Code Online (Sandbox Code Playgroud)

react-native react-native-reanimated react-native-reanimated-v2

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