开发者

Android TimePicker - How to change to AM/PM when the time gets past 12 in 12h mode?

Is there a way to change the time from AM to PM(and vice versa) when the user clicks the '+' or '-' buttons of a TimePicker View, and the time gets past 12?

I'll give an example - If the time now is 11 AM, and the user clicks the '+' button of the TimePicker, the time changes to 12 AM(where it should change to 12 PM).

Is there a way of doing that? Why isn't the TimePicker doing it anyway?

I'm g开发者_StackOverflowetting a lot of angry responses from my users because of this issue.

Any help will do, Thanks


You could use a listener, keep track of the current time and then in the onTimeChanged method you could detect the roll over and change the AM/PM settings yourself.


Try the setIs24HourView(Boolean is24HourView) method? It will remove AM/PM but at least the times will be in 24h mode.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜