<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ### ProgressDialog ProgressDialog與ProgressBar在UI中動態顯示一個加載圖標顯示程序運行狀態。 ProgressDialog是繼承自Android.app.AlertDialog所設計的互動對話窗口,使用時,必須新建ProgressDialog對象,在運行時會彈出“對話框”作為提醒,此時應用程序后臺失去焦點(即此時無法對UI組件進行操作),直到進程結束后,才會將控制權交給應用程序,如果在Activity當中不希望后臺失焦,又希望提示User有某后臺程序正處于忙碌階段,那么ProgressBar就會派上用場了。 ~~~ ProgressDialog pd= new ProgressDialog(TestProgerssDialogActivity.this); // 設置pd風格 pd.setProgress(ProgressDialog.STYLE_SPINNER);//圓形 pd.setProgress(ProgressDialog.STYLE_HORIZONTAL);//水平 // 設置pd標題 pd.setTitle("提示"); // 設置pd提示 pd.setMessage("這是一個圓形進度條對話框"); // 設置pd進度條的圖標 pd.setIcon(R.drawable.flag); // 設置pd的進度條是否不明確 //不滾動時,當前值在最小和最大值之間移動,一般在進行一些無法確定操作時間的任務時作為提示,明確時就是根據你的進度可以設置現在的進度值 pd.setIndeterminate(false); //pd.setProgress(m_count++); // 是否可以按回退鍵取消 pd.setCancelable(true); // 設置pd的一個Button pd.setButton("確定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); // 顯示pd.show(); ~~~ 當有ProgressDialog時,點擊back時,會首先取消ProgressDialog ,以上代碼可以監聽進度條被取消事件(也就是點擊Back鍵取消ProgressDialog),此時可以在這里作一些取消后臺操作的處理。 ### ProgressBar XML重要屬性 ~~~ android:progressBarStyle:默認進度條樣式 android:progressBarStyleHorizontal:水平樣式 ~~~ 重要方法 getMax():返回這個進度條的范圍的上限 getProgress():返回進度 getSecondaryProgress():返回次要進度 incrementProgressBy(int diff):指定增加的進度 isIndeterminate():指示進度條是否在不確定模式下 setIndeterminate(boolean indeterminate):設置不確定模式下 setVisibility(int v):設置該進度條是否可視 重要事件 onSizeChanged(int w, int h, int oldw, int oldh):當進度值改變時引發此事件 ~~~ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Welcome to blog" /> <ProgressBar android:id="@+id/rectangleProgressBar" style="?android:attr/progressBarStyleHorizontal" mce_style="?android:attr/progressBarStyleHorizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:visibility="gone" /> <ProgressBar android:id="@+id/circleProgressBar" style="?android:attr/progressBarStyleLarge" mce_style="?android:attr/progressBarStyleLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" /> <Button android:id="@+id/button" android:text="Show ProgressBar" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> ~~~ 參考: [http://www.jb51.net/article/38532.htm](http://www.jb51.net/article/38532.htm "http://www.jb51.net/article/38532.htm")
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看