Android NumberPickerDialog

参考1:http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/2.0_r1/com/android/mms/ui/NumberPickerDialog.java?av=h 

参考2:http://blog.csdn.net/sun_star1chen/article/details/16330459# 

参考3:TimePickerDialog源码

遇到问题:

设置NumberPicker不可编辑

  mNumberPicker.setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS); 

参考:http://blog.csdn.net/yanjiee/article/details/42237631 

弹出NumberPicker的同时,不弹出系统软键盘

 ((EditText) mNumberPicker.getChildAt(0)).setInputType(InputType.TYPE_NULL);

参考:http://www.xuebuyuan.com/408875.html 

android DatePickerDialog theme :

原文:http://blog.csdn.net/lckj686/article/details/19552793

android datepicker disable keyboard:弹出日期选择框的时候,不弹出软键盘

private void setDisabledTextViews(ViewGroup dp) {

        for (int x = 0, n = dp.getChildCount(); x < n; x++) {

                View v = dp.getChildAt(x);

                if (v instanceof EditText) {

                        //v.setEnabled(false);

                        ((EditText) v).setInputType(InputType.TYPE_NULL);

                } else if (v instanceof ViewGroup) {

                        setDisabledTextViews((ViewGroup)v);

                }

        }

}

setDisabledTextViews(mDatePicker);

setDisabledTextViews(mTimePicker);

参考:http://androiddiscuss.com/1-android-discuss/13392.html 

你可能感兴趣的:(Android NumberPickerDialog)