Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs react native createMaterialTopTabNavigator与基于I18n的阿拉伯语标题不起作用_Reactjs_React Native_React Navigation - Fatal编程技术网

Reactjs react native createMaterialTopTabNavigator与基于I18n的阿拉伯语标题不起作用

Reactjs react native createMaterialTopTabNavigator与基于I18n的阿拉伯语标题不起作用,reactjs,react-native,react-navigation,Reactjs,React Native,React Navigation,我有一个阿拉伯语应用程序,我正在使用forceRTL更新视图和翻译 所有的东西都在工作,除了标签阿拉伯标题没有得到更新 我正在使用react导航的“createMaterialTopTabNavigator,createAppContainer” 如果您有任何相同的建议或参考,请让我知道 以下是我的标签代码 import React, { Component } from 'react'; import { Text, View, Image, Linking, ScrollView, Touc

我有一个阿拉伯语应用程序,我正在使用forceRTL更新视图和翻译

所有的东西都在工作,除了标签阿拉伯标题没有得到更新

我正在使用react导航的“createMaterialTopTabNavigator,createAppContainer”

如果您有任何相同的建议或参考,请让我知道

以下是我的标签代码

import React, { Component } from 'react';
import { Text, View, Image, Linking, ScrollView, TouchableOpacity, SafeAreaView, StyleSheet, Dimensions, StatusBar, AsyncStorage, FlatList } from 'react-native';
import I18n from '../Helpers/i18n';
import { createMaterialTopTabNavigator, createAppContainer } from 'react-navigation';
import Upcoming from "./Upcoming.js";
import History from "./History.js";

const { width, height } = Dimensions.get('window');


const MyBookingTabs = createAppContainer(
  createMaterialTopTabNavigator({
    Upcoming: { 
      screen: Upcoming,
      navigationOptions: {
        title:I18n.t('bookingTableUpcomingText'),
      }
    },
    History: { 
      screen: History,
      navigationOptions: {
        title:I18n.t('bookingTableHistoryText'),
      }

    },
  },
    {
      tabBarPosition: 'top',
      swipeEnabled: true,
      animationEnabled: true,
      tabBarOptions: {
        activeTintColor: '#FFFFFF',
        inactiveTintColor: '#F8F8F8',
        style: {
          backgroundColor: '#f01616',
          //backgroundColor:'#000',
          shadowColor: "#fc301c",
          shadowOffset: {
            width: 0,
            height: 2,
          },
          shadowOpacity: 0.80,
          shadowRadius: 3.84,
          elevation: 5,
        },
        labelStyle: {
          textAlign: 'center',
        },
        indicatorStyle: {
          borderBottomColor: '#fff',
          borderBottomWidth: 1,
        },
      },
    }));


export default class MyBookingTabsComponent extends React.Component {
  constructor(props) {
    super(props);
  }
  render() {
    return (
      <View style={{height:(height-150),}}>
      <MyBookingTabs screenProps={{navigationObj: this.props.screenProps.navigationObj }}/>        
      </View>
    )
  }
}
import React,{Component}来自'React';
从“react native”导入{文本、视图、图像、链接、滚动视图、TouchableOpacity、SafeAreaView、样式表、维度、状态栏、异步存储、平面列表};
从“../Helpers/I18n”导入I18n;
从“反应导航”导入{createMaterialTopTabNavigator,createAppContainer};
从“/uncoming.js”导入即将到来的内容;
从“/History.js”导入历史记录;
const{width,height}=Dimensions.get('window');
const MyBookingTabs=createAppContainer(
createMaterialTopTabNavigator({
即将出版:{
屏幕:即将发布,
导航选项:{
标题:I18n.t(“bookingTableUpcomingText”),
}
},
历史:{
屏幕:历史,
导航选项:{
标题:I18n.t('bookingTableHistoryText'),
}
},
},
{
Tabbar位置:“顶部”,
是的,
animationEnabled:没错,
选项卡选项:{
activeTintColor:“#FFFFFF”,
InactiveIntColor:“#F8F8”,
风格:{
背景颜色:“#f01616”,
//背景颜色:“#000”,
阴影颜色:“fc301c”,
阴影偏移:{
宽度:0,
身高:2,
},
阴影不透明度:0.80,
阴影半径:3.84,
标高:5,
},
标签样式:{
textAlign:'中心',
},
指标类型:{
borderBottomColor:“#fff”,
边界宽度:1,
},
},
}));
导出默认类MyBookingAbsComponent扩展React.Component{
建造师(道具){
超级(道具);
}
render(){
返回(
)
}
}

使用以下代码解决


标题:I18nManager.isRTL?“配置文件”

选项卡在热加载到该页面时得到更新我在createMaterialTopTabNavigator()方面遇到一些问题。我也在使用RTL,但是标签是从左到右而不是从右到左显示的(我说的是带指示器的标签)