QMUITipDialog的使用

1. Loading类型
QMUITipDialog tipDialog= new QMUITipDialog.Builder(getContext())
        .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING)
        .setTipWord("正在加载")
        .create();
2. 成功类型
QMUITipDialog tipDialog= new QMUITipDialog.Builder(getContext())
        .setIconType(QMUITipDialog.Builder.ICON_TYPE_SUCCESS)
        .setTipWord("修改成功!")
        .create();
3. 失败类型
QMUITipDialog tipDialog= new QMUITipDialog.Builder(getContext())
        .setIconType(QMUITipDialog.Builder.ICON_TYPE_FAIL)
        .setTipWord("修改失败!")
        .create();
4. 信息提示类型
QMUITipDialog tipDialog= new QMUITipDialog.Builder(getContext())
        .setIconType(QMUITipDialog.Builder.ICON_TYPE_INFO)
        .setTipWord("请勿重复操作")
        .create();

5. 自定义类型
QMUITipDialog tipDialog= new QMUITipDialog.CustomBuilder(getContext())
        .setContent(R.layout.tipdialog_custom)
        .create();

xml文件:

    

    

只保留图片:去掉setTipWord()

提示框需要显式关闭,一般引用某一控件(如Textview textview)的postDelayed:

textview.postDelayed(new Runnable() {
    @Override
    public void run() {
        tipDialog.dismiss();
    }
}, 2000);//2s

你可能感兴趣的:(QMUITipDialog的使用)