これは私のカスタム番号ピッカーです
public class CustomNumberPicker extends NumberPicker {
public CustomNumberPicker(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
public CustomNumberPicker(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
}
public CustomNumberPicker(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// TODO Auto-generated constructor stub
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev)
{
if (ev.getActionMasked() == MotionEvent.ACTION_DOWN)
{
ViewParent p = getParent();
if (p != null)
p.requestDisallowInterceptTouchEvent(true);
}
return false;
}
}
このナンバーピッカーはスクロールビューにあり、数字をロールするのが難しいため、onInterceptTouchEvent() をオーバーライドします。このカスタマイズされた方法は、TimePicker でうまく機能します。しかし、カスタマイズ後、numberpicker はロールできませんが、uparrow と downarrow はうまく機能します。この問題の解決策を持っている人はいますか? ありがとう!!!!!!