12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- /**
- * Created by zack on 2018/4/30.
- */
- import {
- View,
- Text,
- StyleSheet,
- Image,
- TouchableOpacity,
- TextInput
- } from 'react-native'
- import React, {Component} from 'react'
- import {NavigationBarHeight, TabBarHeight, ScreenDimensions} from '../../../../utils/DimensionsTools'
-
- export default class MyAnswerTitleItem extends Component {
- constructor(props) {
- super(props)
- this.state = {
- title: props.title
- }
- }
-
- componentWillReceiveProps(props) {
- this.setState({title: props.title})
- }
-
- shouldComponentUpdate(nextProps) {
- if (nextProps.title !== this.state.title) {
- return true
- }
-
- return false
- }
-
- render() {
- return(
- <View style={styles.View}>
- <Text style={styles.TitleText}>{this.state.title}</Text>
- </View>
- )
- }
- }
-
- const styles = StyleSheet.create({
- View: {
- width: ScreenDimensions.width,
- backgroundColor: 'white'
- },
- TitleText: {
- marginLeft: 21,
- marginTop: 17,
- fontSize: 15,
- color: '#9c9c9c'
- }
- })
|