我在 react-native 中有以下代码
import React, {Component} from 'react';
import {TabNavigator} from 'react-navigation';
import {View} from 'react-native';
class Home extends Component {
static navigationOptions = {
title:'Home',
tabBarLabel:'First'
};
render() {
return <View></View>;
}
}
const tabOptions = {
tabBarOptions: {
activeTintColor:'white',
inactiveTintColor:'#D3D3D3',
style:{
backgroundColor:'green',
borderTopWidth:1,
borderTopColor:'#D3D3D3'
},
tabBarSelectedItemStyle: {
borderBottomWidth: 2,
borderBottomColor: 'red',
},
},
}
const ProductNavigator = TabNavigator({
First: {screen: Home},
Second:{screen: Home}
},
tabOptions
);
export default ProductNavigator;
这是在 Android 模拟器中渲染时的样子
我希望黄色下划线改为红色下划线。但是我tabBarSelectedItemStyle
声明红色下划线的规则没有得到承认。如何使所选标签栏项目的下划线变为红色?