未验证 提交 ff7d2282 编写于 作者: O openharmony_ci 提交者: Gitee

!20770 对timepicker更新demo代码及动图

Merge pull request !20770 from tengfan/timepicker_0711
...@@ -76,6 +76,9 @@ struct TimePickerExample { ...@@ -76,6 +76,9 @@ struct TimePickerExample {
this.selectedTime.setHours(value.hour, value.minute) this.selectedTime.setHours(value.hour, value.minute)
console.info('select current date is: ' + JSON.stringify(value)) console.info('select current date is: ' + JSON.stringify(value))
}) })
.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}})
}.width('100%') }.width('100%')
} }
} }
......
...@@ -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.
先完成此消息的编辑!
想要评论请 注册