-1
我使用基於本機的組件來創建卡片。 但是,我發現在顯示帶有文本的圖標時出現問題。我想是這樣顯示的:文字無法正確顯示圖標
,但我得到這個結果:
這是我的代碼:
<Card style= {{ flex: 1 , width : width-30 , marginTop :10}}>
<CardItem cardBody>
<Image source= { require('./images/post-media/1.png') } style={{height: 200, width: null, flex: 1}}>
</Image>
</CardItem>
<CardItem style = {{backgroundColor: 'white'}}>
<Body>
<Text style= {styles.txt}>
this is my text blabla blabla blabla
</Text>
<View style={{ borderBottomWidth: 1, borderBottomColor: '#839fcc', width: width-70 }} />
</Body>
</CardItem>
<CardItem >
<Left>
<Button transparent>
<Icon name="time" style={styles.icon} />
<Text>2017.07.05 </Text>
</Button>
</Left>
<Body>
<Button transparent >
<Icon name="heart" style={styles.icon} />
<Text >325</Text>
</Button>
</Body>
<Right>
<Icon name="chatbubbles" style={styles.activeIcon} />
<Text>325</Text>
</Right>
</CardItem>
</Card>
對於風格:
icon: {
color: '#839fcc'
},
activeIcon:{
color:'#0d5be9'
}
有什麼想法嗎?
我的問題是圖標和文本之間的空間。我要刪除它 –
給我完整的代碼...我認爲你的意思是等等等等文本,但是不存在於你的代碼中。 –
我編輯了我的代碼。請檢查它 –