xgfe / react-native-datepicker

react native datePicker component for both Android and IOS, useing DatePikcerAndroid, TimePickerAndroid and DatePickerIOS
MIT License
2.12k stars 725 forks source link

Customising Place Holder #387

Open Anjumzaki opened 4 years ago

Anjumzaki commented 4 years ago

Issue

I want to change the colour of placeholder of the date picker

Expected Behavior

<DatePicker style={styles.forms} date={this.state.dob} //initial date from state mode="date" //The enum of date, datetime and time placeholder="Date of Birth" placeholderTextColor={'black'} allowFontScaling={false} placeholderTextColor={'gray'} format="DD-MM-YYYY" confirmBtnText="Confirm" cancelBtnText="Cancel" customStyles={{ dateIcon: { position: 'absolute', left: 0, top: 4, marginLeft: 0, }, dateText: { fontSize: 19, color: 'white' }, dateInput: { marginLeft: 36, borderWidth:0, placeholderTextColor:'black', alignItems:'flex-start' }, }} onDateChange={dob => { this.setState({ dob }); }} />

Code

Environment

  1. react-native -v:
  2. node -v:
  3. npm -v:
  4. yarn --version:
  5. target platform: Android | iOS
  6. operating system: