-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to change font-family of textInput #634
Comments
@ManigandanRaamanathan TextInput will pick the regular font from the theme. Check this code import * as React from 'react';
import { TextInput } from 'react-native-paper';
export default class MyComponent extends React.Component {
state = {
text: ''
};
render(){
return (
<TextInput
label='Email'
value={this.state.text}
onChangeText={text => this.setState({ text })}
theme={{ fonts: { regular: 'Apple Color Emoji' } }}
/>
);
}
} |
Good work |
You can directly assign fontfamily to TextInput import * as React from 'react'; export default class MyComponent extends React.Component { render(){ |
the following block of code worked💪🏻 import * as React from 'react';
import { TextInput } from 'react-native-paper';
export default class MyComponent extends React.Component {
state = {
text: ''
};
render(){
return (
<TextInput
label='Email'
value={this.state.text}
onChangeText={text => this.setState({ text })}
fontFamily={"Apple Color Emoji"}
theme={{ fonts: { regular: "" } }}
/>
);
}
} |
This code worked for me: <TextInput
theme={
{
fonts: {
regular: {
fontFamily: 'Poppins-Regular'
}
}
}
}
/> |
@anabeatrizzz Thank you very much. Took me a while before I found your solution. |
Using the below code, Still I couldn't change the fontFamily for my Textinput |
I did all the previous solutions but no one worked for me.
|
Worked for me, thanks |
This worked for me, thanks |
contentStyle={{ fontFamily: "Poppins-Medium" }} its worked for me |
@mohcenesegouat Thank you so much, been spending hours looking for this 👍 |
@mohcenesegouat you are a G 🙏🏾. anyone know how to change the label font? |
Current behaviour
Unable to change font-family of textInput. Tried setting the fontFamily through style. But not working
Expected behaviour
Be able to set custom font's for text inputs
What have you tried
Tried setting the fontFamily through style. But not working
Your Environment
The text was updated successfully, but these errors were encountered: