1. 程式人生 > >react-native自定義返回按鈕 headerBackImage

react-native自定義返回按鈕 headerBackImage

class BackImage extends React.Component { //建立一個返回按鈕的元件
  render() {
    return (
      <Image
        source={require('../res/imgs/RightArrow.png')}
        style={{ width: 8, height: 15}}
      />
    );
  }
}
    navigationOptions: () => ({
      headerBackImage:<BackImage/>, //使用元件
      headerTintColor: '#000',
      headerTitleStyle: {
        fontSize: 18
      }
    }),

噹噹噹就好啦~~~~~~~~