Two kinds of dialog boxes for imitation IOS7

Source: Internet
Author: User

have been using the iphone so much like the various controls of iOS, previously done ios7 sliding buttons http://www.eoeandroid.com/thread-331542-1-1.html

This time again imitate iOS7 two kinds of dialog box, QQ also do and ios7 the same, bottom menu list and Alertdialog, the effect is as follows:


1.AlertDialog, using the same method and Android comes with the same

  1. New Alertdialog (mainactivity.this). Builder ()
  2. . Settitle ("title")
  3. . setmsg ("text content")
  4. . Setcancelable (False)
  5. . Setpositivebutton ("Confirm", new Onclicklistener () {
  6. @Override
  7. public void OnClick (View v) {
  8. //
  9. }
  10. }). Setnegativebutton ("Cancel", new Onclicklistener () {
  11. @Override
  12. public void OnClick (View v) {
  13. //
  14. }
  15. })
  16. . Show ();
Copy Code

2.ActionSheetDialog, it's almost alertdialog .
  1. New Actionsheetdialog (mainactivity.this). Builder ()
  2. . Settitle ("title")
  3. . Setcancelable (False)
  4. . Setcanceledontouchoutside (False)
  5. . Addsheetitem ("entry name one", Sheetitemcolor.red,
  6. New Onsheetitemclicklistener () {
  7.                        & nbsp;                          & nbsp;    @Override
  8.                        & nbsp;                          & nbsp;    public void OnClick (int which) {
  9. }
  10. })
  11. . Addsheetitem ("Entry name II", Sheetitemcolor.red,
  12. New Onsheetitemclicklistener () {
  13.                        & nbsp;                          & nbsp;    @Override
  14.                        & nbsp;                          & nbsp;    public void OnClick (int which) {
  15. }
  16. })
  17. Multiple Sheetitem can be added
  18. . Show ();
Copy Code

Code Download: http://download.csdn.net/detail/xiechengfa/8067275

Two kinds of dialog boxes for imitation IOS7

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.