feat:add prompt for android and iOS

This commit is contained in:
pengfei.zhou
2019-11-20 21:04:27 +08:00
parent 2290c8cd48
commit ec854ebe71
5 changed files with 172 additions and 3 deletions

View File

@@ -100,14 +100,45 @@ class ModalDemo extends Panel {
okLabel: "OkLabel",
cancelLabel: 'CancelLabel',
}).then(
e => {
() => {
modal(context).toast('Clicked OK.')
},
e => {
() => {
modal(context).toast('Clicked Cancel.')
})
}
} as IText),
text({
text: "Prompt",
layoutConfig: layoutConfig().w(LayoutSpec.AT_MOST),
textSize: 30,
textColor: Color.WHITE,
bgColor: colors[4],
textAlignment: Gravity.Center,
height: 50,
}),
label('Click me').apply({
width: 200,
height: 50,
bgColor: colors[0],
textSize: 30,
textColor: Color.WHITE,
layoutConfig: layoutConfig().exactly(),
onClick: () => {
modal(context).prompt({
msg: 'This is Prompt.',
title: 'Prompt title',
okLabel: "OkLabel",
cancelLabel: 'CancelLabel',
}).then(
e => {
modal(context).toast(`Clicked OK.Input:${e}`)
},
e => {
modal(context).toast(`Clicked Cancel.Input:${e}`)
})
}
} as IText),
]).apply({
layoutConfig: layoutConfig().atmost().h(LayoutSpec.WRAP_CONTENT),
gravity: Gravity.Center,