Custom DatePicker

前端 未结 3 2245
有刺的猬
有刺的猬 2021-02-20 11:54

I ve been stuck on a DatePicker problem for several and i can\'t seem to find any solution.

I currently have a DatePickerDialog which fits quite well to my needs YET I

3条回答
  •  余生分开走
    2021-02-20 12:06

    There is some change in honeycomb.

    ViewGroup group = (ViewGroup) findViewById(R.id.picker);
    group = (ViewGroup) group.getChildAt(0);
    group = (ViewGroup) group.getChildAt(0);
    // 0:datepicker , 1:calendar
    Toast.makeText(this, String.format("%s children", group.getChildCount()), Toast.LENGTH_SHORT).show();
    try{
        group.getChildAt(0).setVisibility(View.GONE);
        // 0 for year, 1 for month, 2 for day
    }catch(Exception e){
    Toast.makeText(this, e.toString(), Toast.LENGTH_SHORT).show();
    }
    

提交回复
热议问题