提交 4526d044 编写于 作者: T tengfan66

update timepicker dialog

Signed-off-by: Ntengfan66 <tengfan3@huawei.com>
上级 864a9f45
...@@ -46,6 +46,9 @@ struct TimePickerDialogExample { ...@@ -46,6 +46,9 @@ struct TimePickerDialogExample {
.onClick(() => { .onClick(() => {
TimePickerDialog.show({ TimePickerDialog.show({
selected: this.selectTime, selected: this.selectTime,
disappearTextStyle: {color: Color.Red, font: {size: 15, weight: FontWeight.Lighter}},
textStyle: {color: Color.Black, font: {size: 20, weight: FontWeight.Normal}},
selectedTextStyle: {color: Color.Blue, font: {size: 30, weight: FontWeight.Bolder}},
onAccept: (value: TimePickerResult) => { onAccept: (value: TimePickerResult) => {
// 设置selectTime为按下确定按钮时的时间,这样当弹窗再次弹出时显示选中的为上一次确定的时间 // 设置selectTime为按下确定按钮时的时间,这样当弹窗再次弹出时显示选中的为上一次确定的时间
this.selectTime.setHours(value.hour, value.minute) this.selectTime.setHours(value.hour, value.minute)
...@@ -65,6 +68,9 @@ struct TimePickerDialogExample { ...@@ -65,6 +68,9 @@ struct TimePickerDialogExample {
TimePickerDialog.show({ TimePickerDialog.show({
selected: this.selectTime, selected: this.selectTime,
useMilitaryTime: true, useMilitaryTime: true,
disappearTextStyle: {color: Color.Red, font: {size: 15, weight: FontWeight.Lighter}},
textStyle: {color: Color.Black, font: {size: 20, weight: FontWeight.Normal}},
selectedTextStyle: {color: Color.Blue, font: {size: 30, weight: FontWeight.Bolder}},
onAccept: (value: TimePickerResult) => { onAccept: (value: TimePickerResult) => {
this.selectTime.setHours(value.hour, value.minute) this.selectTime.setHours(value.hour, value.minute)
console.info("TimePickerDialog:onAccept()" + JSON.stringify(value)) console.info("TimePickerDialog:onAccept()" + JSON.stringify(value))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册