在React-native中,如何更改NavigatorIOS的样式 [英] in React-native, How to change the styles of NavigatorIOS

查看:113
本文介绍了在React-native中,如何更改NavigatorIOS的样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在react-native中,如何更改NavigatorIOS的样式,例如backgroundColor?谢谢!

in react-native,how to change the styles of NavigatorIOS,such as backgroundColor? thank you!

var speedNews = React.createClass({
  render: function() {
    return (
      <NavigatorIOS style={styles.container} 
      initialRoute={{ 
        title: 'SpeedNews',
        component: ViewList
      }}/>
    );
  }
});

var styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor : 'red', // it do nothing
    color : '#ffffff' // it do nothing
  }
});

推荐答案

据我所知,您只能更改以下属性:

As far as I know, you can only change the following properties:


  • barTintColor :条形背景的颜色。

  • titleTextColor :字体的颜色。

  • tintColor :按钮的颜色。

  • barTintColor: The color of the background of the bar.
  • titleTextColor: The color of the font.
  • tintColor: The color of the buttons.
<NavigatorIOS
  barTintColor='#000'
  titleTextColor='#fff'
  tintColor='#fff'
  initialRoute={{
    title: 'SpeedNews',
    component: ViewList
  }} />

这篇关于在React-native中,如何更改NavigatorIOS的样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆