【问题标题】:React Native Multiple Color Title in Navigation在导航中反应原生多颜色标题
【发布时间】:2018-11-30 17:49:58
【问题描述】:

我想用多种颜色标题实现导航器,但它只设置了一种颜色

如何设置多色标题?

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;

【问题讨论】:

    标签: javascript ios objective-c reactjs react-native


    【解决方案1】:

    很简单,就是代码:

    <Text style={{fontWeight: 'bold'}}>
        I am bold
        <Text style={{color: 'red'}}>
            and red
        </Text>
    </Text>
    

    这是文档:https://facebook.github.io/react-native/docs/text.html

    【讨论】:

      【解决方案2】:

      请在下面找到运行代码

      <Text style={{color: 'red'}}>
          Ho
          <Text style={{color: 'green'}}>
               me
          </Text>
      </Text>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-02-22
        • 2018-06-22
        • 1970-01-01
        • 1970-01-01
        • 2020-09-11
        • 1970-01-01
        相关资源
        最近更新 更多