Android中的對話方塊

來源:互聯網
上載者:User

標籤:


對話方塊(Dialog)
-----------------------------
對話方塊是軟體與使用者“對話”的工具
一、AlertDialog:警告類型的對話方塊
使用AlertDialog.Builder的set系列方法配置對話方塊的資訊,配置完成後,調用create()方法進行建立,並調用show()方法進行顯示。
AlertDialog.Builder的set系列方法:
1) setTitle()
2) setIcon()
3) setMessage()
4) setView()
5) setPositiveButton()
6) setNegativeButton()
二、ProgressDialog:表示進度的對話方塊
ProgressDialog是直接建立該類的對象,並調用set系列方法進行配置,最後調用show()進行顯示。
ProgressDialog的set系列方法:
1) setTitle()
2) setIcon()
3) setMessage()
4) setMax()
5) setProgress() // 該方法應該在對話方塊顯示之後調用
6) setButton()
7) setCancelable()
8) setCanceledOnTouchOutside()
以上2種對話方塊都可以調用dismiss()方法取消顯示

Android中的對話方塊

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.