0
        <Text style={styles.text}>text</Text>
const styles = StyleSheet.create({
  text: {
    backgroundImage: "path-to-image",
    WebkitBackgroundClip: "text",
    backgroundClip: "text",
    color: "transparent"
  }
});

它说“提供给文本的无效 props.style 键”

我究竟做错了什么?它应该是什么?

4

1 回答 1

0

React Native 没有background-clip属性https://reactnative.dev/docs/text-style-props

改用 React Native MaskedView https://www.npmjs.com/package/@react-native-community/masked-view

于 2022-01-25T07:44:09.073 回答