如何在NavigationOptions中淡入标题

时间:2019-09-23 17:08:14

标签: react-native animation

我以前使用过<Animated.View>但是我如何title: "Welcome " + usernameTitle,内淡入static navigationOptions

 static navigationOptions = ({ navigation }) => {
    const { params = {} } = navigation.state;
    const usernameTitle = navigation.getParam("usernameValue") || "";

    return {
-->>  title: "Welcome " + usernameTitle,
      headerLeft: <View />,
      headerStyle: {
        backgroundColor: "#6db6d6",
        height: 50
      },
      headerForceInset: { top: "never" },
      headerTitleStyle: {
        textAlign: "center",
        flex: 1,
        color: "black",
        fontWeight: "bold"
      },
      headerRight: (
        <TouchableOpacity style={styles.btn} onPress={params.removeItemValue}>
          <Text style={styles.btnText}>Log out</Text>
        </TouchableOpacity>
      )
    };
  };

0 个答案:

没有答案