罗广聪

发现 可复制

... ... @@ -7,7 +7,8 @@ import {
Dimensions,
ScrollView,
Text,
TouchableOpacity
TouchableOpacity,
Clipboard,
} from "react-native";
import { StackNavigator, TabNavigator } from "react-navigation";
... ... @@ -54,6 +55,9 @@ export default class Discover extends Component {
}
});
}
copyWords(string) {
Clipboard.setString(string);
}
render() {
const { word, date } = this.state;
return (
... ... @@ -71,7 +75,7 @@ export default class Discover extends Component {
<View style={styles.wordConatier}>
<Text style={styles.word}>{word}}</Text>
</View>
<TouchableOpacity style={styles.button}>
<TouchableOpacity style={styles.button} onPress={() => {this.copyWords(word)}}>
<Image style={styles.btnImg} source={require("../../assets/discover/ic_copy.png")} />
<Text style={styles.btnText}>复制文案</Text>
</TouchableOpacity>
... ...