react-native - 有没有办法在拐角处弯曲 Flatlist?
问题描述
我想开发这个视图,但我不能弯曲平面列表,我还想遮蔽除中心图像以外的图像。我尝试将边框半径赋予父视图和平面列表本身,但它对我不起作用所需视图 在此处输入图像描述
我的观点:在此处输入图像描述
这是我的代码:...
`
import React from 'react';
import {Text, View, StyleSheet, FlatList} from 'react-native';
const List = () => {
const image= <View style={{alignItems:'center',
justifyContent:'center',
width:100,
height:100,
backgroundColor:'red',
borderRadius:50,}}/>
const friends = [
{name: image, Age: '20'},
{name: image, Age: '45'},
{name: image, Age: '30'},
{name: image, Age: '37'},
{name: image, Age: '90'},
{name: image, Age: '200'},
];
return (
<View style={styles.containerStyle}>
<FlatList
style={styles.listStyle}
horizontal={true}
showsHorizontalScrollIndicator={false}
keyExtractor={friend => friend.Age}
data={friends}
renderItem={({item}) => {
return (
<Text style={styles.textpro}>
{item.name}
</Text>
);
}}
/>
</View>
);
};
const styles = StyleSheet.create({
containerStyle:{
borderWidth:1,
borderColor:'white',
flex:1
},
listStyle:{
borderWidth:1,
borderColor:'red',
borderRadius:100,
flex:1,
},
op: {
height: 10,
width: 10,
color: '#00ffff',
},
});
export default List;
//App.js code
<View style={{backgroundColor:'rgb(50,117,220)',height:'30%',backgroundColor:'yellow'}}>
<List />
</View>
`
解决方案
有人让我尝试对原生快照轮播做出反应,这就像一个魅力 idk 为什么他删除了他的评论。我感到很幸运 <3
推荐阅读
- excel - 从关闭的文件中提取作者数据
- android - 光标随机跳过?
- c# - protobuff-net 保存/加载静态字段
- python - 为什么程序在 Spyder 中运行时可以找到 Pandas,而在 R studio 中却找不到?
- python - 循环遍历熊猫数据框
- microsoft-cognitive - 由于订阅密钥无效或 API 端点错误而拒绝访问(认知服务自定义视觉)
- html - 如何在 Jquery 中选择同一类中悬停的一个
- angular - 在模板 ngIf 中将 unix 字符串转换为日期
- http - 使用 fetch 发送和接收文本/纯文本的正确方法
- windows - 一个一个地压缩和删除多个文件夹