Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/27.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.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 反应导航变量选项卡宽度_Reactjs_React Native_React Navigation - Fatal编程技术网

Reactjs 反应导航变量选项卡宽度

Reactjs 反应导航变量选项卡宽度,reactjs,react-native,react-navigation,Reactjs,React Native,React Navigation,在哪里可以设置可变选项卡宽度,而不是在React导航中设置固定选项卡宽度 当前所有选项卡的宽度相同,需要将其包装为文本宽度。您可以使用navigationOptions中的tabBarLabel选项。使用文本元素的“样式”属性,可以设置宽度 navigationOptions: { tabBarLabel: <Text style={{ textAlign: 'center', width: 200 }}>Long Tab Title</Text> }, 导航选项:

在哪里可以设置可变选项卡宽度,而不是在React导航中设置固定选项卡宽度


当前所有选项卡的宽度相同,需要将其包装为文本宽度。

您可以使用navigationOptions中的tabBarLabel选项。使用文本元素的“样式”属性,可以设置宽度

navigationOptions: {
  tabBarLabel: <Text style={{ textAlign: 'center', width: 200 }}>Long Tab Title</Text>
},
导航选项:{
tabBarLabel:长选项卡标题
},