0

As many others before me, I'm looking for the way to customize expo android's theme colors and styles in order to customize native components styles like DatePicker.

I found a lot of posts explaining the same old thing: "Update your style the native android way!"

Ok then, but my React native project doesn't have any "res/values/styles.xml" and so on. Creating them from scratch has no effect.

There's one step that I'm deadly missing here, but which one?

My repo looks a bit like this actually:

.expo
/* a bunch of folders containing my custom js */
App.js
app.json
babel.config.js
package.json
package-lock.json
Pierre Burton
  • 1,954
  • 2
  • 13
  • 27

1 Answers1

0

You can use Style Sheet.

Create a new StyleSheet:

const styles = StyleSheet.create({
  container: {
    borderRadius: 4,
    borderWidth: 0.5,
    borderColor: '#d6d7da',
  },
  title: {
    fontSize: 19,
    fontWeight: 'bold',
  },
  activeTitle: {
    color: 'red',
  },
});

Use a StyleSheet:

<View style={styles.container}>
  <Text style={[styles.title, this.props.isActive && styles.activeTitle]} />
</View>

this is detail link

To configure a style, such as Android.xml, you can separate it by doing expo eject.

When you do expo eject, you get Android folder.

about `expo eject' link

hong developer
  • 13,291
  • 4
  • 38
  • 68
  • Stylesheet is out of the way since I want to style native component like DatePicker as described in the links provided. I will edit my question so it's more clear what I want to achieve. Meanwhile, could you tell me more about expo eject ? – Pierre Burton Apr 11 '19 at 14:13
  • you're going to achieve your goals through `expo eject`. – hong developer Apr 11 '19 at 14:15
  • ejecting from expo is a really bad idea generally – ICW Mar 06 '23 at 19:16