Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set react-native keyboard theme to dark

Trying to set keyboardType on a TextInput with the dark keyboard theme, how do you do this in React Native?

like image 720
tylermadison Avatar asked May 12 '15 18:05

tylermadison


People also ask

How do I set a dark theme in React Native?

Implement Dark Mode Using React NavigationThe `NavigationContainer` of React Navigation allows you to pass the `theme` prop. You can change the theme prop dynamically and all the components will automatically update to reflect the new theme.

How do I change theme color in React Native?

you can use redux to handle this. take 2 set of constant files where you will have all colors and import those two in each class where ever required and while setting color check using props. Ex: <Text style={{color: this. props.


2 Answers

you can set keyboardAppearance in Textinput for change theme 'default', 'light', 'dark'

<TextInput
    keyboardAppearance='dark'
/>
like image 135
Akshay I Avatar answered Sep 23 '22 01:09

Akshay I


It is now supported for iOS.keyboardAppearance prop for iOS for TextInput with possible values of default, light, or dark

As documented here: https://facebook.github.io/react-native/docs/textinput

like image 43
ryan0 Avatar answered Sep 22 '22 01:09

ryan0