No Description

MyAnswerBlankItem.js 951B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * Created by zack on 2018/4/30.
  3. */
  4. import {
  5. View,
  6. Text,
  7. StyleSheet,
  8. Image,
  9. TouchableOpacity,
  10. TextInput
  11. } from 'react-native'
  12. import React, {Component} from 'react'
  13. import {NavigationBarHeight, TabBarHeight, ScreenDimensions} from '../../../../utils/DimensionsTools'
  14. export default class MyAnswerBlankItem extends Component {
  15. constructor(props) {
  16. super(props)
  17. this.state = {
  18. tips: props.tips
  19. }
  20. }
  21. componentWillReceiveProps(props) {
  22. this.setState({
  23. tips: props.tips
  24. })
  25. }
  26. shouldComponentUpdate(nextProps) {
  27. if (nextProps.tips !== this.state.tips) {
  28. return true
  29. }
  30. return false
  31. }
  32. render() {
  33. return(
  34. <View style={styles.View}>
  35. <Text style={styles.Text}>{this.state.tips}</Text>
  36. </View>
  37. )
  38. }
  39. }
  40. const styles = StyleSheet.create({
  41. View: {
  42. width: ScreenDimensions.width,
  43. backgroundColor: '#efeff4',
  44. alignItems: 'center'
  45. },
  46. Text: {
  47. marginTop: 114,
  48. fontSize: 15,
  49. color: '#9c9c9c'
  50. }
  51. })