react-native 自定义Header组件
npm install react-native-yx-header --save
import Header from 'react-native-yx-header'
<View style={styles.container}>
<Header {...this.props} title='标题' righticon={require('./images/ic_avatar_default.png')} renderCustomView={this._renderCustomView}/>
</View>
#####属性说明
- {...this.props} 必须带此声明, 用于获取navigator
- headercolor 导航栏颜色
- showback = {true/false} 是否显示左侧返回图标(文字)
- title 中间标题
- titlecolor 标题颜色
- leftmenu 左侧返回显示的文字
- lefticon 左侧图标
- rightmenu 右侧菜单显示的文字
- righticon 右侧图标
- leftAction 此方法为左侧菜单按钮点击回调, 默认为返回上一级
- titleAction 此方法为标题点击回调
- rightAction 此方法为右侧菜单按钮点击回调
- renderCustomView 此方法实现定义导航栏, return一个视图标签