$tip 返回
阻塞式对话框
i(msg)
版本:1.0.0
[信息]对话框
- 参数 : msg {Object...} 信息内容
$tip.i("我是信息");
v(msg)
版本:1.0.0
[说明]对话框
- 参数 : msg {Object...} 信息内容
$tip.v("我是信息");
w(msg)
版本:1.0.0
[警告]对话框
- 参数 : msg {Object...} 信息内容
$tip.w("我是信息");
e(msg)
版本:1.0.0
[异常]对话框
- 参数 : msg {Object...} 信息内容
$tip.e("我是信息");
d(msg)
版本:1.0.0
[调试]对话框
- 参数 : msg {Object...} 信息内容
$tip.d("我是信息");
input(title,callback)
版本:1.0.0
输入对话框
- 参数 : title {string} 标题
- 参数 : callback {(value)=>{}} 确定按钮回调
$tip.input("请输入你的名字", (value) => {
toast("输入的内容:" + value);
});
input(title,def,callback)
版本:1.0.0
输入对话框(默认值)
- 参数 : title {string} 标题
- 参数 : def {string} 默认值
- 参数 : callback {(value)=>{}} 确定按钮回调
$tip.input("请输入你的名字", "张三", (value) => {
toast("输入的内容:" + value);
});
show(title,msg)
版本:1.0.0
文本提示对话框
- 参数 : title {string} 标题
- 参数 : msg {string} 信息
$tip.show("你好新人", "我是你的AIGame助手");
show(title,msg,click)
版本:1.0.0
文本提示对话框(有回调)
- 参数 : title {string} 标题
- 参数 : msg {string} 信息
- 参数 : click {()=>{}} [确定]按钮回调
$tip.show("你好新人", "我是你的AIGame助手", () => {
toast("你好!");
});
show(title,view)
版本:1.0.0
自定义对话框(右上角关闭)
- 参数 : title {string} 标题
- 参数 : view {View} 自定义view
//解析xml并且获得ui对象
let ui = $ui.view("ag-app-example/$tip - 阻塞式对话框/01.自定义对话框/ui.xml");
//通过ui对象拿到View对象
let view = ui.getView();
//这种方式不会显示底部的按钮
$tip.show("自定义对话框", view);
show(title,view,click)
版本:1.0.0
自定义对话框(确定关闭)
- 参数 : title {string} 标题
- 参数 : view {View} 自定义view
- 参数 : click {()=>{}} 点击确定按钮的回调
//解析xml并且获得ui对象
let ui = $ui.view("ag-app-example/$tip - 阻塞式对话框/01.自定义对话框/ui.xml");
//通过ui对象拿到View对象
let view = ui.getView();
//通过tip显示这个view
$tip.show("自定义对话框", view, () => {
toast("保存成功");
});
one(title,items,callback)
版本:1.0.0
单选对话框
- 参数 : title {string} 标题
- 参数 : items {list[string]} 选项
- 参数 : callback {(value)=>{}} 选择回调
let arr = ["小狗", "小猫", "小猪"];
$tip.one("请选择", arr, (value) => {
toast("你选择了:" + value);
});
more(title,items,callback)
版本:1.0.0
多选对话框
- 参数 : title {string} 标题
- 参数 : items {list[string]} 选项
- 参数 : callback {(values)=>{}} 选择回调
let arr = ["小狗", "小猫", "小猪"];
$tip.more("请选择", arr, (values) => {
toast("你选择了:" + values);
});