Skip to content

Custom NavBar doesn't move to top position #1470

Closed
@mackeee-orange

Description

@mackeee-orange

MyCode

// Router
<Scene
  key="feed_page"
  hideNavBar={false}
  hideTabBar={true}
  initial={true}
  component={FeedPage}
  navBar={Header}
  icon={FeedIcon}
  sceneStyle={simula_styles.tab_scene}
/>
// Header.js
<View style={my_styles.header_container}>
  <View style={my_styles.header_left}>
    <Icon name="view-list"  size={24} color='white'/>
  </View>
  <View style={my_styles.header_center}>
    ---element---
  </View>
  <View style={my_styles.header_right}>
    <Icon name="search"  onPress={this._toggleSearch} size={24} color='white'/>
  </View>
</View>
// my styles
const my_styles = {
  header_container: {
    height: 50,
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'center'
  },
  header_left: {
    width: 50,
    height: 50,
    padding: 13
  },
  header_right: {
    width: 50,
    height: 50,
    padding: 13
  },
  header_center: {
    flex: 4,
    height: 50
  }
}

Expected behaviour

sample

Actual behaviour

sample2

I tried:

header_container: {
    height: 50,
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'center',
    alignSelf: 'flex-start'
}

but, NavBar doesn't move to top position.
Why my navbar doesn't move to top position??

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions