문제

I wrote this code to make a TimePickerDialog box

btnDialBoxTime.setOnClickListener(new OnClickListener() {
    public void onClick(View arg0) {
        MyTimePickerDialog timePickerDialog = new MyTimePickerDialog(AdvancedCDT.this, android.R.style.Theme_DeviceDefault, timeSetListener, 0, 0, true);
        timePickerDialog.setTitle("Set hours and minutes"); 
        timePickerDialog.show();

    }

    });

The dialog box appear correctly but the Theme is white.

I would like to have it black/gray which is the default of my Nexus 7.

The android.R.style.Theme_DeviceDefault does not seem to function.

도움이 되었습니까?

해결책

Use one of the five built-in AlertDialog themes:

For instance:

    MyTimePickerDialog timePickerDialog = new MyTimePickerDialog(AdvancedCDT.this,
            TimePickerDialog.THEME_HOLO_DARK, timeSetListener, 0, 0, true);

Results

Example

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top