javascript - 带有手风琴列表的 ScrollView 溢出导航器边界
问题描述
ScrollView
由于屏幕上显示的数据量,我需要使用。
但是,当它首次显示时,手风琴列表全部折叠。在通过用户单击展开它们中的任何一个后,ScrollView
(在 flex 布局内)将展开底部导航栏的边界。
例如,我想限制它,bottom:60
但它无法正常工作。
这是我拥有的当前标签:
<View style={{flex:10,padding:10, flexDirection:"column", justifyContent:"space-around"}}>
...
<ScrollView style={{flex:9, bottom:60}} contentContainerStyle={{flexGrow:1, bottom:60}} >
我已经尝试只使用该 contentContainerStyle
属性,而没有使用该属性,style
但它也不起作用。
有谁知道如何正确设置这种风格?
解决方案
终于弄明白了......没有注意到<SafeAreaView>
官方ScrollView链接上提到的:https ://facebook.github.io/react-native/docs/scrollview
它以这种方式运作良好:
scrollDimensions = [{
width: Math.round(Dimensions.get('window').width - 20),
maxHeight: Math.round(Dimensions.get('window').height - 200 )
}];
...
let sDimensions = this.scrollDimensions;
...
<View style={{flex:20, margin:4, flexDirection:"column", justifyContent:"flex-start"}}>
<Title style={{flex:1}}>New Subject</Title>
<SafeAreaView style={[{flex:19, }, sDimensions]}>
<ScrollView
contentContainerStyle={{}} >
...
推荐阅读
- python - 应用程序错误django部署heroku
- syntax - SML 语法分解
- html - 框内和前面的 HTML 文本
- java - 这些 Spring/Hibernate 实体对于烹饪应用程序是否良好(性能方面)?
- android - Mpandroidchart 将值显示为文本
- file - 下载 Atom 后我的电脑中有很多 .py 文件
- r - 将两个 excel 数据集加载到 R 中的问题
- ios - 防止这种与 Optional 相关的崩溃的最佳方法是什么?
- javascript - 删除按钮永远不会被触发 onclick
- python - 如何使用 Post 请求从 html 表单将图像文件存储在 Django 中?