【发布时间】:2016-05-16 01:26:56
【问题描述】:
在 React Native 中,我有一个静态的书籍数组,我将其映射并以堆叠的行输出,如下所示:
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 中,我们会使用 last-child)
【问题讨论】:
-
我不知道反应但底部没有到最后?像borderWidthBottom?
-
books[books.length - 1] 是 javascript 中的最后一本
标签: reactjs react-native