英文:
How can I make my card view littile circular in react native
问题
在下面的代码中,我试图根据我的用户体验设计创建一个UI。但我面临的一个问题是无法创建与UX中相同的卡片,UX中的卡片是圆形的,但在我的代码中不是。我尝试过使用边框半径,但没有成功。请建议我在哪里出错。
<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 key={index}>
<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>
左侧是UX,右侧是我正在做的事情。
英文:
//
In below code I am trying to make on ui according to my ux design . But One problem i am facing is not able to make card like same in ux , in ux its someting circular ,but in my code its not coming. It tried with border radius also . Please suggest where I am wrong
<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>
答案1
得分: 1
以下是您要翻译的内容:
应该尝试这个:
<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={`${'钱包余额'}`} 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={'添加金额'} 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={'支付账单'} textColor='grey' />
</View>
</View>
)
}
)}
</View>
</Card>
</View>
如果您需要任何进一步的翻译或帮助,请告诉我。
英文:
You should try this :
<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>
答案2
得分: 1
以下是代码部分的翻译:
<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>
请注意,这只是代码部分的翻译,不包括代码中的注释或其他非代码的内容。如果您需要进一步的帮助或有其他问题,请随时提出。
英文:
For your another question :
<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>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论