标签:style blog http io ar color sp 文件 on
效果图:
工程图:
此代码需要加入第三方库MBProgressHUD
代码:
RootViewController.h
#import <UIKit/UIKit.h> //加入头文件 #import "MBProgressHUD.h" @interface RootViewController : UIViewController <MBProgressHUDDelegate> { MBProgressHUD *HUD; } @end
RootViewController.m
#import "RootViewController.h" //加入头文件 #import <unistd.h> - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. //转动3s后停止 HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view]; HUD.delegate = self; [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES]; [self.navigationController.view addSubview:HUD]; } //等待3s - (void)myTask { sleep(3); }
标签:style blog http io ar color sp 文件 on
原文地址:http://www.cnblogs.com/yang-guang-girl/p/4134313.html