我需要更改TouchableHighlight样式组件中的<Text/>的颜色。已尝试:
const Button = styled.TouchableHighlight`
width: 100%;
justify-content: center;
background-color: #337ab7;
Text {
color: orange;
}
`;没有用..。另外,这个Text来自react-native,而不是一个样式化组件。
发布于 2020-11-26 12:38:13
为Text创建单独的样式组件
// styled component
const StyledText = styled.Text`
color: orange;
`;并在代码中使用StyledText而不是Text
https://stackoverflow.com/questions/65015874
复制相似问题