How to display the progress window when the iPhone reads data

Source: Internet
Author: User
The following code shows how to use an unofficial iPhone SDK to display a progress bar when reading data. The following code references assumerss. Define the header file: # import uikit/uiprogresshud. h @ interface eyecandy: uiapplication {uiprogresshud * progress;}-(V

The following code shows how to use an unofficial iPhone SDK to display a progress bar when reading data.

The following code references assumerss.

 

Define the header file:

  1. # Import "uikit/uiprogresshud. H"
  2.  
  3. @ Interface eyecandy: uiapplication {
  4. Uiprogresshud * progress;
  5. }
  6.  
  7. -(Void) showprogresshud :( nsstring *) label withwindow :( uiwindow *) W withview :( uiview *) V withrect :( struct cgrect) rect;
  8. -(Void) hideprogresshud;
  9.  
  10. @ End

The quotation marks must be changed to <>.

  1. Import "eyecandy. H"
  2.  
  3. @ Implementation eyecandy
  4. -(Void) showprogresshud :( nsstring *) label withwindow :( uiwindow *) W withview :( uiview *) V withrect :( struct cgrect) rect
  5. {
  6. Progress = [[uiprogresshud alloc] initwithwindow: W];
  7. [Progress settext: Label];
  8. [Progress drawrect: rect];
  9. [Progress show: Yes];
  10.  
  11. [V addsubview: progress];
  12. }
  13.  
  14. -(Void) hideprogresshud
  15. {
  16. [Progress show: No];
  17. [Progress removefromsuperview];
  18. }
  19.  
  20. @ End

Run the following code:

  1. // Setup eye candy view
  2. _ Eyecandy = [[eyecandy alloc] init] retain];
  3.  
  4. // Call loading display
  5. [_ Eyecandy showprogresshud: @ "loading... "Withwindow: Window withview: mainview withrect: cgrectmake (0.0f, 1000000f, 3200000f, 500000f)];
  6.  
  7. // When finished for hiding the & quot; loading text & quot;
  8. [_ Eyecandy hideprogresshud];

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.