0

I have my background colour for views in all activities set to black. I try to use the standard date picker view. Unfortuneatley text seems to be black. This makes it invisible. Up to now I have been using code to change some text. I tried to do

    childpicker1 = (ViewGroup) findViewById(Resources.getSystem().getIdentifier("month" 
    /*rest is: day, year*/,    "id", "android"));

    EditText textview1 = (EditText) childpicker1.getChildAt(0);


    textview1.setTextColor(Color.WHITE);

And this seems to initially work but when I try to scroll or select another value the text goes back to black so thats not good. Does anyone now what is the best way to change the text colour of the date picker in android ?

Frank Brosnan
  • 231
  • 1
  • 2
  • 8
  • If you are loading this DatePicker from a layout, why can't you use android:calendarTextColor? – Michael Krause Oct 31 '14 at 20:36
  • Hi Michael, thanks for this from what I know that attribute only works in api 21 so only for the latest android. I am trying to support api 10-21 so my app gets wide reach. But thanks for the comment. – Frank Brosnan Nov 02 '14 at 16:14
  • I seemed to be able to change color using the answers for this question.http://stackoverflow.com/questions/8837480/android-honeycomb-datepicker-text-color So I used a theme which seemed to do the trick. I just had to change the color to white and this updated the date picker controls. – Frank Brosnan Nov 02 '14 at 16:19

0 Answers0