@yoonzm/react-native-alphabet-flat-list
v1.3.0
Published
使用FlatList制作的react-native字母选择列表
Downloads
89
Readme
Installation
- Using npm:
npm install @yoonzm/react-native-alphabet-flat-list --save
- Using Yarn:
yarn add @yoonzm/react-native-alphabet-flat-list
Example
import React, {Fragment} from 'react';
import {StatusBar, Text, View} from 'react-native';
import AlphabetFlatList from "react-native-alphabet-flat-list";
import ContactItem, {CONTACT_ITEM_HEIGHT, IContact} from "./ContactItem";
...
const HEADER_HEIGHT = 50;
const App = () => {
return (
<Fragment>
<StatusBar barStyle="dark-content"/>
<AlphabetFlatList<IContact>
data={data}
itemHeight={CONTACT_ITEM_HEIGHT}
headerHeight={HEADER_HEIGHT}
renderItem={ContactItem}
ListHeaderComponent={(
<View style={{
height: HEADER_HEIGHT,
justifyContent: 'center',
alignItems: 'center'
}}>
<Text>ListHeaderComponent</Text>
</View>
)}
/>
</Fragment>
);
};
Props
data
(Object) [isRequire] - listData to displayitemHeight
(Number) [isRequire] - itemComponent heightrenderItem
(Function) [isRequire] - itemComponent rendersectionHeaderHeight
(Number) - sectionHeader height; default is 25renderSectionHeader
(Function) - sectionHeaderListHeaderComponent
(Function) - ListHeaderalphabetToast
(Boolean) - click on the letter to prompt
Download
| 类型 | 二维码 | | ----------- | ---------------------------------------- | | Apk二维码 | | | IOS暂无下载 | |