【发布时间】:2020-09-17 06:22:55
【问题描述】:
【问题讨论】:
【问题讨论】:
请将您的BorderLayout 更改为以下格式。
return (
<View style={[styles.parent,props.style]}>
/* remaining code */
</View>
)
您不需要使用 flatten,因为 View 需要一组样式作为输入。通过以下方法,可以使用 style 属性覆盖 BorderLayout 默认样式。
所做的更改:
将 props.style 移动到数组的末尾,以便它覆盖默认样式(在您的情况下为 backgroundColor)。
【讨论】:
在你的BorderLayout,
return(
<View style={props.style}>
//rest implementation
</View>
)
请确保您已从 StyleSheet.flatten(...) 中删除 props.style
【讨论】: