깜박임이 발생한다.
깜박임을 방지하기 위해 다음과 같이 처리할 수 있다.
| private void setNpbgFixxer( NumberPicker np ){ | |||||||
| try { | |||||||
| Method method = np.getClass().getDeclaredMethod("changeValueByOne", boolean.class); | |||||||
| method.setAccessible(true); | |||||||
| method.invoke(np, true); | |||||||
| } catch (NoSuchMethodException e) { | |||||||
| e.printStackTrace(); | |||||||
| } catch (IllegalArgumentException e) { | |||||||
| e.printStackTrace(); | |||||||
| } catch (IllegalAccessException e) { | |||||||
| e.printStackTrace(); | |||||||
| } catch (InvocationTargetException e) { | |||||||
| e.printStackTrace(); | |||||||
| } | |||||||
| Field f = null; | |||||||
| try { | |||||||
| f =NumberPicker.class.getDeclaredField("mInputText"); | |||||||
| } catch (NoSuchFieldException e) { | |||||||
| e.printStackTrace(); | |||||||
| } | |||||||
| f.setAccessible(true); | |||||||
| EditText inputText = null; | |||||||
| try { | |||||||
| inputText = (EditText)f.get(np); | |||||||
| } catch (IllegalAccessException e) { | |||||||
| e.printStackTrace(); | |||||||
| } | |||||||
| inputText.setFilters(new InputFilter[0]); | |||||||
| } | |||||||