How to set TimePicker show with format 24h

前端 未结 11 991
独厮守ぢ
独厮守ぢ 2020-12-29 18:17

I\'ve created a TimePicker in layout and I want it to show time with format 24h.

Can you help me? Thanks.

11条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-29 18:37

    You just need call and send true to setIs24HourView function.

    TimePicker tpHourMin = (TimePicker) findViewById(R.id.timePicker);
    tpHourMin.setIs24HourView(true);
    

提交回复
热议问题