简体   繁体   中英

Localize Android DatePickerDialog

是否可以配置android.app.DatePickerDialog以便它可以轻松地本地化为欧洲格式(交换日期和月份并将英文按钮名称与本地化的按钮交换)?

The DatePickerDialog is localized by default. I tried it on a real device and the localization of the dialog adapts to the system default.

You could design 2 DatePickerDialog s and use a condition based on the Locale class to choose between one or the other. However, as there is no "Europe" locale, but only countries locales, you might need to put the european locales in a list, and check if the locale is in the list. The current locale of the phone is accessed with : Locale.getDefault()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM