devaige / DatePicker

Useful and powerful date picker for android
Apache License 2.0
1.86k stars 414 forks source link

首先感谢您提供这么优质的代码,然后想请教下,如何跳转到指定的日期呢? #24

Closed Haofengshang closed 4 years ago

Haofengshang commented 8 years ago

我是这么写的,Toast.makeText(mActivity, "跳转到2016-8", Toast.LENGTH_LONG).show(); this.setDate(2016, 8); this.setMode(DPMode.SINGLE);

第一次点击跳转的按钮可以执行,然后左右随便滑动一下,日历就刷新不了了,只会更新头部的年月。有没有一个刷新的方法?希望能得到您的解答。非常感谢!

XiaoMaGe258 commented 8 years ago

同问,等爱哥解答~

devaige commented 8 years ago

https://github.com/AigeStudio/DatePicker/issues/17

rw15250 commented 8 years ago

void setDate1(int year, int month) { centerYear = year; centerMonth = month; indexYear = 0; indexMonth = 0; buildRegion(); computeDate(); requestLayout(); invalidate();

    smoothScrollTo(0, 0);
    lastMoveX =0;
}

这样就ok了