问题描述
每次移动选项卡时,都会收到“动画事件必须具有事件数据”错误,我真的不知道是什么原因以及原因。 我很乐意为此提供一些帮助。 我创建了3个标签,每次在它们之间移动时,都会出现此错误。我不知道该怎么解决。 此错误的原因是什么?为什么在我的情况下发生?
import React,{ useState } from 'react';
import { Text,View } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs';
import { useRoute,useNavigation } from '@react-navigation/native';
function NetuneyDigum() {
return (
<>
<View
style={{
flex: 1,justifyContent: 'center',alignItems: 'center',backgroundColor: '#cbced4',}}
>
<Text>NetuneyDigum!</Text>
</View>
</>
);
}
function BdikotSadea() {
return (
<View
style={{
flex: 1,}}
>
<Text>BdikotSadea!</Text>
</View>
);
}
function E_BitsuaDigdum() {
return (
<View
style={{
flex: 1,}}
>
<Text>E_BitsuaDigdum!</Text>
</View>
);
}
const Tab = createMaterialTopTabNavigator();
export default function Screen8() {
const navigation = useNavigation();
const route = useRoute();
const params = route.params;
const { item } = params;
console.log('screen 8: ',params);
return (
<Tab.Navigator
tabBarOptions={{
activeTintColor: '#275d9f',inactiveTintColor: 'gray',indicatorStyle: {
backgroundColor: 'red',},style: {
// backgroundColor: '#8bb8ef',labelStyle: {
fontSize: 18,fontWeight: 'bold',}}
>
<Tab.Screen name="one" component={NetuneyDigum} />
<Tab.Screen name="two" component={BdikotSadea} />
<Tab.Screen name="three" component={E_BitsuaDigdum} />
</Tab.Navigator>
);
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)