Reactjs 来自react native elments的标头不工作
我一直在使用react原生元素,但似乎无法获得要渲染的头组件。我把react原生元素中的所有其他组件都搞乱了,它们似乎都能工作 --标题不起作用,但常规文本或搜索栏起作用Reactjs 来自react native elments的标头不工作,reactjs,react-native,Reactjs,React Native,我一直在使用react原生元素,但似乎无法获得要渲染的头组件。我把react原生元素中的所有其他组件都搞乱了,它们似乎都能工作 --标题不起作用,但常规文本或搜索栏起作用 render() { return ( <Header leftComponent={{ icon: 'menu', style: { color: '#fff'} }} centerComponent={{ text: 'MY TITLE', style: { co
render() {
return (
<Header
leftComponent={{ icon: 'menu', style: { color: '#fff'} }}
centerComponent={{ text: 'MY TITLE', style: { color: '#fff' } }}
rightComponent={{ icon: 'home', style: { color: '#fff'} }}
/>
);
}
}
render(){
返回(
);
}
}
艾哈迈德
请尝试以下代码。这对我有用。然而,现在我的问题是标题下面的内容覆盖在它上面
<Header
statusBarProps={{ barStyle: 'light-content' }}
centerComponent={{ text: 'Dashboard', style: { color: '#fff' } }}
outerContainerStyles={{ backgroundColor: '#324C66' }}
/>
我认为颜色在风格上应该是这样的
<Header
leftComponent={{ icon: 'menu', color: '#fff' }}
centerComponent={{ text: 'MY TITLE', color:'#fff'}}
rightComponent={{ icon: 'home', color: '#fff'}}
/>