react native contacts
1. flatList scrollToIndex 函数实现跳转到指定字母开头的联系人
2. 数据处理,将接口数据处理成组件需要的数据
效果:
/**
* Created by hmlk on 2018/7/19 14:15
*/
import React, {Component} from 'react'
import {
SafeAreaView,
View,
Text,
Image,
FlatList,
ScrollView,
TextInput,
StyleSheet,
TouchableOpacity,
TouchableWithoutFeedback
} from 'react-native'
import Device from './utils/Device'
import SeparatorLine from './components/SeparatorLine'
export default class RecordSearch extends Component {
constructor(props) {
super(props)
this.state = {
contacts: [
{id: 101, name: '阿菊'},
{id: 102, name: '爱莲'},
{id: 103, name: '昂立拉克'},
{id: 104, name: '冰冰'},
{id: 105