反应本机导航栏颜色更改错误

时间:2018-08-15 11:53:16

标签: javascript react-native

我想更改导航栏的背景色,但返回到我:TypeError:对象不是一个函数(正在评估“ renderHeader”);

如何解决此错误?

 static navigationOptions = ({navigation}) => ({
        title: 'Login', 
        header: {
            title: "Title",
            style: {
              backgroundColor: 'red'
            },
            tintColor: 'red'
          }
    });

2 个答案:

答案 0 :(得分:3)

尝试一下...

static navigationOptions = () => ({
    title: 'Contact Us',
    headerTintColor: Colors.Green,
    headerStyle: {
      backgroundColor: 'red'
    }
  });

为特定页面隐藏navigationbar

static navigationOptions = {
         header:null
    }

答案 1 :(得分:2)

我猜,group by dno, dname应该是对象。试试这个:

select max(dno) ... group by dname
相关问题