IOS _ 3rd library MBprogressHUD, iosmbprogresshud

Source: Internet
Author: User

IOS _ 3rd library MBprogressHUD, iosmbprogresshud

1. Add the downloaded 3rd-party library MBprogressHUD source code package to the project (which is actually a. h and. m file)

2. Go to Build Phases of the project and add all. m files in the source code package to the project.

3. Add the master header file "MBProgressHUD. h" of the 3rd-party class library"


Show Code:

// At the beginning of loading, a prompt message is displayed: MBProgressHUD * hud = [MBProgressHUD showHUDAddedTo: webView animated: YES]; // Add a mask hud. dimBackground = YES; hud. labelText = @ "loading the page... ";
Hide code:

// After loading, hide the prompt [MBProgressHUD hideAllHUDsForView: webView animated: YES];

Custom image display:

// Extracted, only for internal classification calling + (void) showMsg :( NSString *) msg imgName :( NSString *) imgName {// MBProgressHUD * hud = [MBProgressHUD showHUDAddedTo: [UIApplication sharedApplication]. keyWindow animated: YES]; // display mode, changed to customView, that is, display the custom image (mode setting, must be written before customView value assignment) hud. mode = MBProgressHUDModeCustomView; int delay = 1; if ([imgName is1_tostring: @ "error.png"]) {// when an error occurs, the system prompts 3 seconds of delay = 3 ;} imgName = [NSString stringWithFormat: @ "MBProgressHUD. bundle/% @ ", imgName]; // set the custom image hud to be displayed. customView = [[UIImageView alloc] initWithImage: [UIImage imageNamed: imgName]; // displayed text, for example, loading failed... loading... hud. labelText = msg; // flag: It must be YES to hide. When hidden, remove the hud from the parent control. removeFromSuperViewOnHide = YES; // automatically hide logs (@ "% d", delay) after 3 seconds; [hud hide: YES afterDelay: delay];}
Other common attributes
// The background color hud of the prompt box. color = [UIColor clearColor]; // This indicates no background. // The following text hud is displayed. detailsLabelText = @ "detail"; // shadow mask effect hud. dimBackground = YES; // hide [hud hide: YES afterDelay: 1] After 1 second; // only show the text hud. mode = MBProgressHUDModeText; // the margin and Y offset hud. margin = 0; hud. yOffset = 0; // hide and remove the hud from the parent control. removeFromSuperViewOnHide = YES; // circular progress bar hud. mode = MBProgressHUDModeAnnularDeterminate;





Asio determines whether the network is normal

Then include the header file in the class to be judged:

[Cpp] view plaincopy
# Import "Reachability. h"

[If you use the ASIHTTPRequest class library, you can directly import Reachbility. h. The ASIHTTP class library contains Reachbility. h and. m]

The following is a method I wrote:

[Cpp] view plaincopy
-(BOOL) isConnectionAvailable {

BOOL isExistenceNetwork = YES;
Reachability * reach = [Reachability reachabilityWithHostName: @ "www.apple.com"];
Switch ([reach currentReachabilityStatus]) {
Case NotReachable:
IsExistenceNetwork = NO;
// NSLog (@ "notReachable ");
Break;
Case ReachableViaWiFi:
IsExistenceNetwork = YES;
// NSLog (@ "WIFI ");
Break;
Case ReachableViaWWAN:
IsExistenceNetwork = YES;
// NSLog (@ "3G ");
Break;
}

If (! IsExistenceNetwork ){
MBProgressHUD * hud = [MBProgressHUD showHUDAddedTo: self. view animated: YES]; // <span style = "font-family: Arial, Helvetica, sans-serif;"> MBProgressHUD is a third-party library, you do not need to omit or use AlertView </span>
Hud. removeFromSuperViewOnHide = YES;
Hud. mode = MBProgressHUDModeText;
Hud. labelText = NSLocalizedString (INFO_NetNoReachable, nil );
Hud. minSize = CGSizeMake (132.f, 108.0f );
[Hud hide: YES afterDelay: 3];
Return NO;
}

Retur ...... remaining full text>

In which folder is the AS3 class library of flash CS3? What is the third-party class library? How to use which folder should I put?

I am sorry for not paying attention to the class library. Below are some classes to be useful to you. Regardless of the folder, you can call the required path as long as your reference path is correct.

Flash flex as3 class library
The following is a very useful class library. I was very excited when I found them.
APIs, Libs, Components

1. as3ebaylib
Code.google.com/p/as3ebaylib/

2. as3youtubelib
Code.google.com/p/as3youtubelib/

3. as3flickrlib
Code.google.com/p/as3flickrlib/

4. Yahoo ASTRA Flash Components
Developer.yahoo.com/flash/astra-flash/

5. facebook-as3
Code.google.com/p/facebook-as3/

6. as3awss3lib
Code.google.com/p/as3awss3lib/

7. Adobe ActionScript 3: resources: apis: libraries (official, including corelib, FlexUnit, Flickr, Mappr, RSS and Atom libraries, Odeo, and YouTube)
Labs.adobe.com/..raries

8. A set of animation libraries that Tweener uses for transition and switching
... The remaining full text>

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.