Javascript 如何使我的卡片视图在react native中呈小圆形
在下面的代码中,我试图根据我的用户体验设计在用户界面上实现。但我面临的一个问题是不能在ux中制作出同样的卡片,在ux中它是一种循环,但在我的代码中它不会出现。它还尝试了边界半径。请指出我错在哪里Javascript 如何使我的卡片视图在react native中呈小圆形,javascript,reactjs,react-native,Javascript,Reactjs,React Native,在下面的代码中,我试图根据我的用户体验设计在用户界面上实现。但我面临的一个问题是不能在ux中制作出同样的卡片,在ux中它是一种循环,但在我的代码中它不会出现。它还尝试了边界半径。请指出我错在哪里 {info.technologies.map( (数据、索引)=>{ 返回( ) } )} 您应该尝试以下方法: <View style={{ marginBottom: 10, marginLeft: 5, marginRight: 5, borderRadius: 2, padding
{info.technologies.map(
(数据、索引)=>{
返回(
)
}
)}
您应该尝试以下方法:
<View style={{ marginBottom: 10, marginLeft: 5, marginRight: 5, borderRadius: 2, padding: 10 }} >
<Card >
<CardItem header style={{ flexDirection: 'row', backgroundColor: '#fff', width: '100%', justifyContent: 'space-between', borderBottomColor: '#f1f1f1', borderBottomWidth: 1,borderRadius: 80 }}>
<View style={{paddingTop:10 }}>
<RegularText text={`${'Wallet Balance'}`} textColor='grey'style={{ fontWeight: 'bold', flexWrap: 'wrap',color:'grey' }} />
</View>
<View style = {{ width : wp('10%'),height: wp('10%'),backgroundColor : '#E091C9' ,borderRadius : hp('1%'), margin : 8,flexDirection :'row',justifyContent :'center',alignItems : 'center'}}>
<SvgCss xml={WALLET} width={15} height={15} />
</View>
<View style={{
flexDirection: 'column',
height: 25, paddingRight: 10, paddingLeft: 10, paddingTop: 5,paddingBottom:30}}>
<SmallText text={'MUR 110.00'} textColor='red' />
<SmallText text={'Add Money'} textColor='blue' />
</View>
</CardItem>
<View style = {{flexDirection : 'row',paddingLeft:24,paddingRight:24}}>
{info.tecnologies.map(
(data, index) => {
return (
<View>
<View style = {{width : wp('14%'),height: wp('14%'),backgroundColor : 'rgb(163, 153, 233)',borderRadius : hp('2%'), margin : 10,flexDirection :'row',justifyContent :'center',alignItems : 'center'}}>
<SvgCss xml={PAY_BILL} width={15} height={15} />
</View>
<View style={{paddingLeft:15,paddingBottom:15}}>
<SmallText text={'Pay Bill'} textColor='grey' />
</View>
</View>
)
}
)}
</View>
</Card>
</View>
{info.technologies.map(
(数据、索引)=>{
返回(
)
}
)}
关于您的另一个问题:
<View style={{ marginBottom: 10, marginLeft: 5, marginRight: 5, borderRadius: 2, padding: 10 }} >
<Card style={{ borderRadius: 8 }}>
<CardItem header style={{ flexDirection: 'row', backgroundColor: '#fff', width: '100%', justifyContent: 'space-between', borderBottomColor: '#f1f1f1', borderBottomWidth: 1,borderRadius: 80 }}>
<View style={{paddingTop:10 }}>
<RegularText text={`${'Wallet Balance'}`} textColor='grey'style={{ fontWeight: 'bold', flexWrap: 'wrap',color:'grey' }} />
</View>
<View style = {{ width : wp('10%'),height: wp('10%'),backgroundColor : '#E091C9' ,borderRadius : hp('1%'), margin : 8,flexDirection :'row',justifyContent :'center',alignItems : 'center'}}>
<SvgCss xml={WALLET} width={15} height={15} />
</View>
<View style={{
flexDirection: 'column',
height: 25, paddingRight: 10, paddingLeft: 10, paddingTop: 5,paddingBottom:30}}>
<SmallText text={'MUR 110.00'} textColor='red' />
<SmallText text={'Add Money'} textColor='blue' />
</View>
</CardItem>
<View style = {{flexDirection : 'row',paddingLeft:24,paddingRight:24}}>
{info.tecnologies.map(
(data, index) => {
return (
<View>
<View style = {{width : wp('14%'),height: wp('14%'),backgroundColor : 'rgb(163, 153, 233)',borderRadius : hp('2%'), margin : 10,flexDirection :'row',justifyContent :'center',alignItems : 'center'}}>
<SvgCss xml={PAY_BILL} width={15} height={15} />
</View>
<View style={{paddingLeft:15,paddingBottom:15}}>
<SmallText text={'Pay Bill'} textColor='grey' />
</View>
</View>
)
}
)}
</View>
</Card>
</View>
{info.technologies.map(
(数据、索引)=>{
返回(
)
}
)}
您可以使用borderRadius
在俯视组件中尝试使用borderRadius:50谢谢。。。你能帮我一个忙吗。。在carditeam中,有钱包余额,然后是图标钱包,然后添加“钱”和Mur 100。。我只是把列放在行的第二个元素里面,把第二个元素对齐在正确的位置。我的意思是,你应该在答案本身,而不是在注释中解释你做了什么。只是一个友好的建议,如何让你的答案更清楚:)
<View style={{ marginBottom: 10, marginLeft: 5, marginRight: 5, borderRadius: 2, padding: 10 }} >
<Card style={{ borderRadius: 8 }}>
<CardItem header style={{ flexDirection: 'row', backgroundColor: '#fff', width: '100%', justifyContent: 'space-between', borderBottomColor: '#f1f1f1', borderBottomWidth: 1,borderRadius: 80 }}>
<View style={{paddingTop:10 }}>
<RegularText text={`${'Wallet Balance'}`} textColor='grey'style={{ fontWeight: 'bold', flexWrap: 'wrap',color:'grey' }} />
</View>
<View style = {{ width : wp('10%'),height: wp('10%'),backgroundColor : '#E091C9' ,borderRadius : hp('1%'), margin : 8,flexDirection :'row',justifyContent :'center',alignItems : 'center'}}>
<SvgCss xml={WALLET} width={15} height={15} />
</View>
<View style={{
flexDirection: 'column',
height: 25, paddingRight: 10, paddingLeft: 10, paddingTop: 5,paddingBottom:30}}>
<SmallText text={'MUR 110.00'} textColor='red' />
<SmallText text={'Add Money'} textColor='blue' />
</View>
</CardItem>
<View style = {{flexDirection : 'row',paddingLeft:24,paddingRight:24}}>
{info.tecnologies.map(
(data, index) => {
return (
<View>
<View style = {{width : wp('14%'),height: wp('14%'),backgroundColor : 'rgb(163, 153, 233)',borderRadius : hp('2%'), margin : 10,flexDirection :'row',justifyContent :'center',alignItems : 'center'}}>
<SvgCss xml={PAY_BILL} width={15} height={15} />
</View>
<View style={{paddingLeft:15,paddingBottom:15}}>
<SmallText text={'Pay Bill'} textColor='grey' />
</View>
</View>
)
}
)}
</View>
</Card>
</View>
<View style={{ marginBottom: 10, marginLeft: 5, marginRight: 5, borderRadius: 2, padding: 10 }} >
<Card style={{ borderRadius: 8 }}>
<CardItem header style={{ flexDirection: 'row', backgroundColor: '#fff', width: '100%', justifyContent: 'space-between', borderBottomColor: '#f1f1f1', borderBottomWidth: 1,borderRadius: 80 }}>
<View style={{paddingTop:10 }}>
<RegularText text={`${'Wallet Balance'}`} textColor='grey'style={{ fontWeight: 'bold', flexWrap: 'wrap',color:'grey' }} />
</View>
<View style = {{ width : wp('10%'),height: wp('10%'),backgroundColor : '#E091C9' ,borderRadius : hp('1%'), margin : 8,flexDirection :'row',justifyContent :'center',alignItems : 'center', alignSelf : 'flex-end'}}>
<SvgCss xml={WALLET} width={15} height={15} />
<View style={{
flexDirection: 'column',
height: 25, paddingRight: 10, paddingLeft: 10, paddingTop: 5,paddingBottom:30}}>
<SmallText text={'MUR 110.00'} textColor='red' />
<SmallText text={'Add Money'} textColor='blue' />
</View>
</View>
</CardItem>
<View style = {{flexDirection : 'row',paddingLeft:24,paddingRight:24}}>
{info.tecnologies.map(
(data, index) => {
return (
<View>
<View style = {{width : wp('14%'),height: wp('14%'),backgroundColor : 'rgb(163, 153, 233)',borderRadius : hp('2%'), margin : 10,flexDirection :'row',justifyContent :'center',alignItems : 'center'}}>
<SvgCss xml={PAY_BILL} width={15} height={15} />
</View>
<View style={{paddingLeft:15,paddingBottom:15}}>
<SmallText text={'Pay Bill'} textColor='grey' />
</View>
</View>
)
}
)}
</View>
</Card>
</View>