import React, { Component } from "react"; import { StyleSheet, Text, View, Image, TextInput, TouchableOpacity } from "react-native"; export default class Comment extends Component { constructor(props) { super(props); this.state = { text: '', input: false, default: '写评论' }; } render() { return ( {this.props.title} this.comments()}> 写评论 小幸运 2019-07-05 回复 爱上识字爱上文字的美,了解文字,幽默风趣的画风,动画识字展示让识字更有趣,跟喜欢。 卡通小熊 爱上识字爱上文字的美,了解文字,幽默风趣的画风,动画识字展示让识字更有趣,跟喜欢。 { this.state.input ? this.setState({text})} value={this.state.text} numberOfLines={7} multiline = {true} autoFocus = {true} defaultValue= {this.state.default} /> 发送 : null } ); } comments() { this.setState({ input: true }) } } const styles = StyleSheet.create({ courseComment: { width: '100%', backgroundColor: '#fff', marginTop: 8, marginBottom: 60 }, padding: { paddingLeft: 20, paddingRight: 20, paddingTop: 10, paddingBottom: 10, }, title: { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', }, font: { fontSize: 24, color: 'black', fontWeight: 'bold', }, center: { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'center', }, button: { width: 98, height: 28, fontSize: 20, borderRadius: 28, color: 'black', backgroundColor: '#F0F1F5' }, headImg: { width: 40, height: 40, backgroundColor: "red", marginRight: 10, borderRadius: 40 }, iconSize: { width: 20, height: 20, marginRight: 10 }, reply: { width: 16, height: 15, marginRight: 5 }, courseFont: { color: '#373737', fontSize: 16 }, column: { display: 'flex', flexDirection: 'column', backgroundColor: '#F3F6FF' }, color: { color: '#518AD1' }, input: { width: '100%', height: 124, backgroundColor: '#F9F9F9', paddingLeft: 18, paddingTop: 18, paddingBottom: 18, paddingRight: 24, display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'flex-end' } });