点击按钮后,显示等待界面,应该怎么做。

七步777 2015-03-19 09:34:09
刚学android,现在想实现点击按钮显示一个半透明转圈的遮罩层,待操作完成后再取消。

...全文
393 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Carry_小超 2015-03-19
  • 打赏
  • 举报
回复
如果开始学就用ProgressDialog  http://blog.csdn.net/dzc372787439/article/details/44201159 这个是自定义的加载圈
ESC尛蜜蜂 2015-03-19
  • 打赏
  • 举报
回复

private ProgressDialog progDialog = null;
progDialog = new ProgressDialog(this);
progDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progDialog.setIndeterminate(false);
progDialog.setCancelable(true);
progDialog.setMessage("正在努力加载中...\n");
progDialog.show();
完成加载用progDialog.dismiss();
qq_24438773 2015-03-19
  • 打赏
  • 举报
回复
用dialog做
七步777 2015-03-19
  • 打赏
  • 举报
回复
界面是线性布局
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#cccccc" >

        <EditText
            android:id="@+id/textsource"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="@string/textsourcehint" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:orientation="horizontal" >

        <Button
            android:id="@+id/btok"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/buttonok" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#cccccc" >

        <EditText
            android:id="@+id/textresult"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="@string/textresulthint" />
    </LinearLayout>

</LinearLayout>
浅笑_JIE 2015-03-19
  • 打赏
  • 举报
回复
自定义对话框ProgressDialog 完成后 调用 dismiss();

80,354

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧