日期、时间选择器【系统的】底部取消、确定按钮不显示
baowenqing opened this issue · comments
作者大大你好,目前依赖项目XUI版本1.1.9【implementation ['com.github.xuexiangjys:XUI:1.1.9'】,在style也继承了xui的样式。但是出现一个bug——取消和确定按钮的颜色不见了,经测试在1.1.9的demo下 也复现该问题
正式项目 或者 不继承XUITheme.Phone主题色的情况下 正常情况地址:【https://upload-images.jianshu.io/upload_images/6111030-0d249bb58100ba08.png?imageMogr2/auto-orient/strip|imageView2/2/w/720/format/webp】
继承主题色后 异常的图片地址:【https://upload-images.jianshu.io/upload_images/6111030-7559a55c18ec6f32.jpg?imageMogr2/auto-orient/strip|imageView2/2/w/1080/format/webp】
代码如下
inline fun Context.showDatePicker(
crossinline method: (date: String) -> Unit
) {
val calendar = Calendar.getInstance()
DatePickerDialog(
this, { view: DatePicker?, year: Int, monthOfYear: Int, dayOfMonth: Int ->
val date = String.format("%d-%02d-%02d", year, monthOfYear + 1, dayOfMonth)
method.invoke(date)
}, calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH),
calendar.get(Calendar.DAY_OF_MONTH)
)
.show()
}
复现手机型号:
红米K30 5G版
小米note9