reactjs - 发布消息底部平面列表
问题描述
我需要从下到上定位消息,但 FlatList 不支持定位
<FlatList
ListEmptyComponent={<ActivityIndicator style={{marginTop: 20}} size="large" color="gray" />}
data={DATA}
renderItem={({ item, index }) => (
<Message
key={index}
text={item.title}
uri={item.uri}
name={item.name}
time={item.time}
sticker={item.sticker}
anim={item.anim}
audio={item.audio}
link={item.link}
/>
)}
keyExtractor={item => item.id}
/>
解决方案
可以在 FlatList 上使用 CSS 来完成
style={{flex:1, position: 'absolute', bottom: 0, width:"100%" }}
已编辑
style={{width:"100%", height: "100%", justifyContent:"flex-end"}}
推荐阅读
- networking - 如何在 Kubernetes 中启用 default-http-backend 以使 Ingress 正常工作?
- javascript - 使用 LuminousGallery 类时如何注入字幕
- c# - LINQ 使用 2 个不同的数据库上下文排除记录
- jboss - 如何在 JBoss EAP 7 域集群上禁用欢迎页面
- ios - React Native iOS 中的键盘语言?
- c++ - 构建过程在 Visual Studio 2019 中以发布模式挂起
- mysql - XAMPP 控制面板 - 错误:MySQL 意外关闭
- flutter - Flutter Text 溢出带有边框半径的父容器
- mysql - SQL查询连接2个表并显示最终结果与两个表相似的列值
- javascript - 如何将抽屉放在标题 React-JS 下方