Android NumberPicker without blinking cursor
I'm using the NumberPicker under the Android SDK level 13 inside a fragment. Works 开发者_如何学Gofine, but each time the activity is started the cursor is blinking behind the number. How can I get rid of the blinking cursor, I don't know why this widget has the focus. This is the xml of the NumberPicker:
<NumberPicker android:id="@+id/timer_picker_hrs"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
I get this solution from somewhere but I don't remember from where. This works good for me, just do this in your activity.
myNumberPicker.setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS);
You can also set this in XML:
android:descendantFocusability="blocksDescendants"
(Borzh comment)
One way of removing the blinking cursor is disabling the soft keyboard for the NumberPicker. (refer to: Disable soft keyboard on NumberPicker )
It's gaining focus because of child CustomEditText
you need to move focus to other view or disable soft input
se my answer for solution:
how disable focus on NumberPicker
精彩评论