在陣營母語,我的書,我映射了一個靜態數組和輸出在堆疊的行這樣的:React Native - CSS:沒有邊界的最後一個孩子?
return books.map((book, i) => {
return(
<View style={styles.book} key={i}>
<Text style={styles.book}>{book.title}</Text>
</View>
);
});
我也有在每本書下邊框通過styles.book
:
book: {
borderBottomWidth: 1,
borderBottomColor: '#000000'
}
我需要列表中的最後一本書沒有底部邊框,所以我需要將borderBottomWidth: 0
應用於它我認爲?在React Native中,我如何獲得列表中的最後一本書沒有底部邊界? (在正常的CSS,我們會使用最後一子)
我不知道反應,但底部不來在結束了嗎?像borderWidthBottom? – YOU
書[books.length - 1]是javascript中的最後一個 – YOU