如何在React导航头中设置背景图像

时间:2018-07-27 10:28:31

标签: javascript reactjs react-native react-navigation

我如何在React导航标题中设置背景图片...

static navigationOptions = ({ navigation }) => {
  return {
    headerTitle: (
      <View
        style={{ flex: 1, flexDirection: "row", justifyContent: "center" }}
      >
        <Image
          source={require("../assets/logo.png")}
          style={{ width: 50, height: 50, alignSelf: "center" }}
          resizeMode="contain"
        />
      </View>
    ),
    headerStyle: {
      backgroundColor: "#2c8ba6"
    },
    headerRight: null,
    headerLeft: null
  };
};

0 个答案:

没有答案