How to change textsize in datepicker?

前端 未结 6 1170
梦如初夏
梦如初夏 2020-12-10 14:22

The default textsize in datepicker is too big for my app. I\'ve seen a way suggested to change it here, but fishing around for the textviews nested inside the datepicker cl

6条回答
  •  被撕碎了的回忆
    2020-12-10 14:38

    use below code

     DatePicker picker = (DatePicker)findViewById(R.id.dp_date);
        ViewGroup childpicker
    
         = (ViewGroup)
        findViewById(Resources.getSystem().getIdentifier("month" /*rest is:
        day, year*/, "id", "android"));
    
        EditText textview = (EditText)
        picker.findViewById(Resources.getSystem().getIdentifier("timepicker_input",
        "id", "android"));
        textview.setTextSize(30);
        textview.setTextColor(Color.GREEN);
    

提交回复
热议问题