我想实现具有多种颜色标题的导航器,但它只能设置一种颜色
如何设置多种颜色标题?
class Home extends Component {
render() {
return (
<View>
<StatusBar barStyle="light-content" />
</View>
);
}
}
Home.navigationOptions = {
title: 'Home',
headerStyle: {
backgroundColor: MyConstants.colorNavbar,
},
headerTitleStyle: {
color: 'white',
},
headerBackTitleStyle: {
color: 'white',
},
headerTintColor: 'white',
};
export default Home;
答案 0 :(得分:1)
这很简单,这是代码:
<Text style={{fontWeight: 'bold'}}>
I am bold
<Text style={{color: 'red'}}>
and red
</Text>
</Text>
答案 1 :(得分:0)
请在下面找到运行代码
<Text style={{color: 'red'}}>
Ho
<Text style={{color: 'green'}}>
me
</Text>
</Text>