-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
时间格式年月日、月日年顺序修改;语言国际化(英文、繁体...) #1009
Comments
This was referenced May 9, 2022
Open
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
在海外的项目中,由于用户的习惯不同,在时间选择的格式上常常需要用到“ 月 日 年 ”这样的顺序和月份的本地化,但是博主大佬提供的自定义方法只有年月日时分的固定顺序以及显示隐藏,并且月份也只能是数字,以下是一些灵性的解决方法,欢迎大家继续补充!!!
1.时间格式的顺序修改
在 TimePickerBuilder 的 TimePickerView 中,我们可以发现有一份可以自定义的布局,里面通常包括五个WheelView,分别显示年月日时分,所以如果想要调整时间格式的顺序,直接修改布局即可!这里贴一份自己项目中的布局:
`
2.语言国际化
实现思路主要是修改 WheelView 类的 getContentText 方法,根据阿拉伯数字返回我们所需的文字即可。但是 WheelView 类的 getContentText 方法是私有,我们只能手动下载下来该方法的可见性。
上面的 EnglishMonthWheelView 参考了issue #575
The text was updated successfully, but these errors were encountered: