Change Button Font Size on React Native [closed]
You can use react-native-elements with titleStyle
props.
import {Input, Button} from 'react-native-elements';<Button onPress={this.addPicture} titleStyle={{ color: "white", fontSize: 16, }} buttonStyle={{ backgroundColor: "white", borderRadius: 60, flex: 1, height: 30, width: 30, }} title="+"/>
I have a feeling you're not using a Text
element inside of your Touchable
:
import React from 'react';import { TouchableWithoutFeedback, Text } from 'react-native';export default function ComponentName() { return ( <TouchableWithoutFeedback> <Text style={{ fontSize: 24 }}>Button Text</Text> </TouchableWithoutFeedback> );}
Unfortunately, according to the documentation (https://reactnative.dev/docs/button) you can't change a font-size of a button. The only style prop you can change is color
.
<Button onPress={onPressLearnMore} title="Learn More" color="#841584" accessibilityLabel="Learn more about this purple button"/>