Tre*_*hue 0 reactjs react-native react-native-ios
我遇到了来自 react-native-elements 的 Header 组件的奇怪问题。这是我所看到的:

这是代码:
<Header
leftComponent={{ icon: 'menu', color: '#85106a', }}
rightComponent={<Avatar
small
rounded
source={{uri: "https://s3.amazonaws.com/uifaces/faces/twitter/ladylexy/128.jpg"}}
onPress={() => console.log("Works!")}
activeOpacity={0.7}
/>}
statusBarProps={{ barStyle: 'dark-content', translucent: true }}
/>
Run Code Online (Sandbox Code Playgroud)
我希望底部的边框与汉堡菜单的颜色相同。我查看了组件的文档,但没有找到任何实质内容。
任何想法都非常感谢。谢谢
我已经尝试过你的项目,所以你需要containerStyle在标题组件上添加道具并更改样式,如下所示:
<Header
leftComponent={{ icon: 'menu', color: '#85106a', }}
rightComponent={<Avatar
small
rounded
source={{uri: "https://s3.amazonaws.com/uifaces/faces/twitter/ladylexy/128.jpg"}}
onPress={() => console.log("Works!")}
activeOpacity={0.7}
/>}
statusBarProps={{ barStyle: 'dark-content', translucent: true }}
containerStyle={{ borderBottomColor:'#85106a',borderBottomWidth:1 }}
/>
Run Code Online (Sandbox Code Playgroud)
然后结果是:
我希望这个答案可以帮助你
请注意此帖子的未来访问者:
在最新版本的 react-native-element (1.1.0) 上,覆盖头容器样式的 propsouterContainerStyles已更改为containerStyle
| 归档时间: |
|
| 查看次数: |
3429 次 |
| 最近记录: |