#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
activityView=[[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(50, 50, 30, 30)];
[activityView setCenter:CGPointMake(160, 140)];
[activityView setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleGray];
[self.view addSubview:activityView];
[activityView startAnimating];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)onClicked:(id)sender {
[activityView stopAnimating];
}
- (IBAction)onDialog:(id)sender {
UIAlertView * alertView=[[UIAlertView alloc] initWithTitle:@"Hello" message:@"你好呀" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:@"取消", nil];
[alertView show];
}
@end