React Native 更改按钮文本颜色
React Native change Button Text color
我是 React Native 的初学者,我只想在其中编写第一行代码。我制作了一个按钮并开始思考如何更改按钮中文本的颜色和其他属性。
<Button title="Click Me"></Button>
我也在想有没有什么好的包推荐给新手的。感谢您的帮助。
你可以像这样使用来自 react-native 的 Button,也可以传递颜色属性。
Button
onPress={onPressLearnMore}
title="Click Me"
color="#841584"
/>
对于复杂和自定义按钮,您可以使用由 react-native 提供的 Touchables 通过您自己的样式创建它,您不必为此使用任何第三方库。
示例:
<TouchableOpacity style={{ here you can specify custom styles for button container }} onPress={gotoDashboard}>
<Text style={{here you can specify text styles}}>Button Text Here</Text>
// You can add there as many components according to your designs.
</TouchableOpacity>
我是 React Native 的初学者,我只想在其中编写第一行代码。我制作了一个按钮并开始思考如何更改按钮中文本的颜色和其他属性。
<Button title="Click Me"></Button>
我也在想有没有什么好的包推荐给新手的。感谢您的帮助。
你可以像这样使用来自 react-native 的 Button,也可以传递颜色属性。
Button
onPress={onPressLearnMore}
title="Click Me"
color="#841584"
/>
对于复杂和自定义按钮,您可以使用由 react-native 提供的 Touchables 通过您自己的样式创建它,您不必为此使用任何第三方库。
示例:
<TouchableOpacity style={{ here you can specify custom styles for button container }} onPress={gotoDashboard}>
<Text style={{here you can specify text styles}}>Button Text Here</Text>
// You can add there as many components according to your designs.
</TouchableOpacity>