peacechen / react-native-modal-selector

A cross-platform (iOS / Android), selector/picker component for React Native that is highly customizable and supports sections.
MIT License
369 stars 129 forks source link

How to change ModalSelector text color? #153

Closed lucascooelho closed 3 years ago

lucascooelho commented 3 years ago

Hi guys, I've been looking for this in forum but I couldn't fine any solution for this. I have tried to change text color of my selector but it still dark, is there any thing I'm doing wrong? I already tried all the options when it says TextStyle and I got nothing.

image

This is my selector

<ModalSelector
              style={styles.picker}
              sectionTextStyle={{color: colors.primary}}
              optionTextStyle={{color: colors.primary}}
              cancelTextStyle={{color: colors.error}}
              initValue="Select Category"
              cancelText="Cancel"
              data={categories.map((category, key) => {
                return {
                  key: category.id,
                  label: category.description,
                };
              })}
              onChange={(option) => {

              }}
            >
              <TextInput
                style={styles.pickerTextInput}
                editable={false}
                placeholder={selectedCategory}
              />
            </ModalSelector>

Also these are the styles I set up for them.

picker: {
    width: '90%',
    margin: 20,
    marginBottom: -3,
    paddingHorizontal: 2,
    paddingVertical: 10
  },
pickerTextInput: {
    width: '100%',
    height: 45,
    color: colors.secondary,    
    borderColor: colors.secondary,
    borderWidth: 1,
    backgroundColor: colors.surface,
  },

Am I doing something wrong in there?

peacechen commented 3 years ago

Is that dark text in the TextInput the placeholders? If so, use placeholderTextColor

https://reactnative.dev/docs/0.33/textinput#placeholdertextcolor

lucascooelho commented 3 years ago

Is that dark text in the TextInput the placeholders? If so, use placeholderTextColor

https://reactnative.dev/docs/0.33/textinput#placeholdertextcolor

Thanks man, It was exactly like you said. A small thing that I did pay attention on.