显示加载微调的最好方法? [英] Best way to show a loading spinner?

查看:139
本文介绍了显示加载微调的最好方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是展示装载微调,而应用程序正在等待服务器响应的最好方法是什么?

可以这样做编程?所以,我没有加负载微调的xml文件?

解决方案

  ProgressDialog进度=新ProgressDialog(本);
progress.setTitle(加载);
progress.setMessage(稍等...);
progress.show();
//要关闭该对话框
progress.dismiss();
 

  ProgressDialog.show(这一点,加载,稍等...);
 

点击此处了解更多。

顺便说一句,微调有不同的含义在Android中。 (这就像在HTML选择下拉)

What is the best way to show a loading spinner while the app is waiting for a response from the server?

Can this be done programmatically? So that I don't have to add the load spinner in the xml file?

解决方案

ProgressDialog progress = new ProgressDialog(this);
progress.setTitle("Loading");
progress.setMessage("Wait while loading...");
progress.show();
// To dismiss the dialog
progress.dismiss();

OR

ProgressDialog.show(this, "Loading", "Wait while loading...");

Read more here.

By the way, Spinner has a different meaning in Android. (It's like the select dropdown in HTML)

这篇关于显示加载微调的最好方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆