React-Native SectionList使用
React native 使用
2023-09-27 14:28:59 时间
- SectionList的简单实用
const titles = [
{ key: '0', data: ['目录一', '目录一', '目录一', '目录一'] },
{ key: '1', data: ['目录二'] },
{ key: '2', data: ['目录二'] }
];
<SectionList
SectionSeparatorComponent{this.sectionSeparatorComponent.bind(this)}
ListHeaderComponent={this.listHeaderComponent.bind(this)}
sections={titles}
renderItem={this.renderItem.bind(this)}
keyExtractor={this.keyExtractor.bind(this)}
>
</SectionList>
keyExtractor(item, index) {
return item;
}
listHeaderComponent() {
return (
<View style={{ height: autoHeight(10) }}></View>
);
}
sectionSeparatorComponent() {
return (
<View style={{ height: autoHeight(10) }}></View>
);
}
- 效果图如下
image.png
相关文章
- React-状态提升
- [转] React 是什么
- React Native:真机断点调试+跨域资源加载出错问题解决
- react 的死循环
- react-native-scrollable-tab-view 实现 TabBar
- react-native 组件默认属性(defaultProps) 及 属性类型验证(PropTypes)
- react 项目实战(五)渲染用户列表
- react 项目实战(三)表单验证
- react-navigation
- React-Native 之 GD (十五)搜索模块 及 设置模块
- React-Native 之 GD (四)使用通知方式隐藏或显示TabBar
- React Native商城项目实战14 - 首页中间下部分
- React Native商城项目实战10 - 个人中心中间内容设置
- React Native商城项目实战08 - 设置“More”界面cell
- react-native 项目实战 -- 新闻客户端(1) -- 初始化项目结构
- React Native安装步骤
- 基于create-react-app的打包后文件路径问题
- react-native-router-flux 定义底部导航栏 定义菜单图标及文字
- React 组件
- React-Native的hello word
- React Native安卓项目打包发布APK步骤
- React-Hooks中的useReducer
- REACT NATIVE——REACT-NAVIGATION的使用
- React之ref操作DOM(ref = {input=>this.input = input})
- react-native-scrollable-tab-view组件的简单使用
- arcgis api 4.x for js 结合 react 入门开发系列"esri-loader"篇(附源码下载)
- 21个React开发神器