123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- /**
- * Created by zack on 2018/4/29.
- */
- 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'
-
- export default class FindViewController extends Component {
- constructor(props) {
- super(props)
- this.state = {
-
- }
- this.props.navigator.setStyle({
- navBarCustomView: 'FindSearchTitleView',
- })
- }
-
- renderItem() {
- return(
- <FindSearchResultItem
- 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'
- }
- })
|