这个简单的类:
class DateSelectionDialogFragment : DialogFragment() {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val calendar = Calendar.getInstance()
val year = calendar.get(Calendar.YEAR)
val month = calendar.get(Calendar.MONTH)
val dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH)
return DatePickerDialog(requireContext(), this, year, month, dayOfMonth)
}
}
导致奇怪的行为按钮。重要的是我没有为对话框指定任何样式。来自包装DialogFragment
。androidx.fragment.app