12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- /**
- * Created by zack on 2018/4/30.
- */
- import {
- View,
- Text,
- StyleSheet,
- FlatList
- } from 'react-native'
- import React, {Component} from 'react'
- import {NavigationBarHeight, TabBarHeight, ScreenDimensions} from '../../../utils/DimensionsTools'
- import FindSearchResultItem from './View/FindSearchResultItem'
- import BaseNavigationBarStyle from '../../base/BaseNavigationBarStyle'
- import MoreSpecialQuestionTitleItem from './View/MoreSpecialQuestionTitleItem'
- import MoreSpecialQuestionItem from './View/MoreSpecialQuestionItem'
-
- export default class MoreViewController extends Component {
- constructor(props) {
- super(props)
- this.state = {
-
- }
- //根据init props来发送通知类型
- this.props.navigator.setStyle({
- navBarCustomView: 'FindSearchTitleView',
- })
- }
-
- renderItem(item) {
- if (item.index === 0) {
- return(
- <MoreSpecialQuestionTitleItem/>
- )
- }else {
- return(
- <MoreSpecialQuestionItem
- didSelectedItem = {() => {
- this.props.navigator.push({
- screen: 'AnswerDetailViewController',
- title: '问答',
- backButtonTitle: '',
- passProps: {
-
- },
- navigatorStyle: BaseNavigationBarStyle
- })
- }}
- />
- )
- }
-
- }
-
- render() {
- return(
- <View style={styles.View}>
- <View style={styles.ListView}>
- <FlatList
- data = {[{index: 0}, {index: 1}, {index: 2}, {index: 3}, {index: 4}, {index: 5}, {index: 6}, {index: 1}, {index: 2}]}
- renderItem={({item}) => this.renderItem(item)}
- keyExtractor = {(item,index) =>{
- return 'key' + item.key + index
- }}
- ListFooterComponent = {() => {
- return(
- <View style={{width: ScreenDimensions.width, height: 44, backgroundColor: 'white'}} />
- )
- }}
- />
- </View>
- </View>
- )
- }
- }
-
- const styles = StyleSheet.create({
- View: {
- width: ScreenDimensions.width,
- height: ScreenDimensions.height - NavigationBarHeight.height,
- backgroundColor: 'white'
- },
- ListView: {
- marginTop: NavigationBarHeight.height,
- width: ScreenDimensions.width,
- height: ScreenDimensions.height - NavigationBarHeight.height,
- backgroundColor: 'white'
- }
- })
|