简体   繁体   中英

Customize time picker

Is it possible to customize the standart time picker as in the below picture?

The time picker i want to make

I can create my own time picker with the below code:

    mTimePicker = TimePickerDialog(this, AlertDialog.THEME_HOLO_DARK , {
            _, hourOfDay, min -> selectedTime.text = String.format("%d : %d", hourOfDay, min) },
        hour, minute, true)

    selectedTime.setOnClickListener {
        mTimePicker.show()
    }

And result:

My own Timepicker

I need to customize time picker somehow as in the first picture.

How can i do that?

You can create a custom DialogFragment , add a timePicker an the rest of the ui components such as buttons and the switch.

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