H5+ nativeUI
-
-
beginPullRefresh()
-
(前提:已设置了下拉刷新效果) 当前窗口调用下拉刷新效果
Example
$plus.ui.beginPullRefresh()
-
closeWaiting()
-
关闭系统等待对话框
Example
$plus.ui.closeWaiting()
-
pullRefresh( [style] [, callback])
-
当前Webview窗口的下拉刷新效果
Parameters:
Name Type Argument Default Description style
object <可选>
{} Webview窗口下拉刷新样式,参考HTML5+ API
callback
function <可选>
(win)=>{} Webview窗口下拉刷新事件回调,接收的参数为:结束Webview窗口的下拉刷新function
Examples
$plus.ui.pullRefresh({ support: true, color: "#2BD009", style: "circle", offset: "0px", range: "80px", height: "50px" }, function(win) { win.endPullToRefresh() } )
$plus.ui.pullRefresh({ support: true, style: "default", range: "30px", height: "30px", contentdown: { caption: "下拉可以刷新" }, contentover: { caption: "释放立即刷新" }, contentrefresh: { caption: "正在刷新..." } }, function(win) { win.endPullToRefresh() } );
$plus.ui.pullRefresh({ support: false }) $plus.ui.pullRefresh()
-
showWaiting(title)
-
显示系统等待对话框
Parameters:
Name Type Default Description title
string '' 标题
Example
$plus.ui.showWaiting("载入中")
-
toast(msg, opts)
-
显示自动消失的提示消息
Parameters:
Name Type Description msg
string 提示消息上显示的文字内容
opts
object 提示消息参数,只有lineLength属性是扩展的,
下列只是部分常用的,其他完整的可以参考HTML5+ API。Properties
Name Type Argument Default Description lineLength
number <可选>
0 提示信息(msg)的手动换行长度,单位是字节,0表示不处理。
verticalAlign
string <可选>
'bottom' 屏幕中的垂直位置:可选值为"top"、"center"、"bottom",分别为垂直居顶、居中、居底。
icon
string <可选>
'' 显示的图标:png格式,并且必须是本地资源地址;
默认图标与文字分两行显示,上面显示图标,下面显示文字。duration
string <可选>
'short' 显示的时间:可选值为"long"、"short","long"约为3.5s,"short"约为2s。
Examples
$plus.ui.toast( "创建并显示系统样式提示消息,弹出的提示消息为非阻塞模式,显示指定时间后自动消失。长时间提示消息显示时间约为3.5s,短时间提示消息显示时间约为2s。", { verticalAlign: "top", duration: "short", lineLength: 0 } )
$plus.ui.toast( "创建并显示系统样式提示消息,弹出的提示消息为非阻塞模式,显示指定时间后自动消失。长时间提示消息显示时间约为3.5s,短时间提示消息显示时间约为2s。", { verticalAlign: "center", duration: "short", lineLength: 13 } )
// 图标png格式,并且必须是本地资源地址(Hbuilder的App项目路径,不能是远程路径) $plus.ui.toast("提案成功", { verticalAlign: "center", icon: "/ui/ok.png" } )