javascript - 滚动视图切断平铺列表的底部
问题描述
我的 React 项目中有一个滚动视图,它应该列出数据映射。这些图块还打开手风琴样式以显示更多信息。九个项目应该被映射和查看,但是滚动视图只显示 7 个并且最后一个被切断/手风琴和瓷砖本身。
尝试:使用 flex: 1 在它周围创建一个视图,使用 FlexGrow 而不是 flex,添加高度:100。
<ScrollView style={styles.contentContainer}>
<View style={styles.accordianContainer}>
<Accordion
sections={this.props.gyms}
activeSections={this.state.activeSections}
renderHeader={this._renderHeader}
renderContent={this._renderContent}
onChange={this._updateSections}
underlayColor={"#ffffff"}
/>
</View>
</ScrollView>
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
},
contentContainer: {
flex: 1,
borderColor: 'red',
borderWidth: 1,
},
accordianContainer: {
height: ( Layout.noStatusBarHeight)* .9,
width: Layout.window.width,
marginBottom: Layout.window.height / 4,
}
解决方案
我有类似的问题,我通过在滚动视图底部添加一个具有特定高度的额外视图找到了解决方案:
<View style={{height: 54}} />
希望对你有帮助。
推荐阅读
- spring-data-jpa - java.lang.AssertionError:JSON 路径“$[0].sClientAcctId”处没有值
- sql - 使用 SSIS 将 excel 数据插入 SQL Server
- javascript - Dropzone.js 配置选项无法识别
- angular - 打字稿查询字符串值到 GUID
- alpha - kubeadm alpha 阶段 etcd 本地 - 使用 localhost 绑定而不是主机 ip 创建 etcd
- python - 添加嵌套包以安装需要,setup.py
- jdk1.7 - jdk1.7 Double.parseDouble 在计算量大的多线程条件下变慢
- c# - 视频时长是应有的两倍
- centos7 - 在没有 Sudo 的情况下启动 haproxy:启动前端 http-in:无法绑定套接字
- excel - 将多个工作簿最后一行的数据复制并粘贴到另一个工作簿中的工作表中