ios 系统自带的菊花(UIActivityIndicatorView)指示器


//

//  RootViewController.m

//  UIActivityIndicatorViewDemo

//

//  Created by Dubai on 15/4/28.

//  Copyright (c) 2015 Dubai. All rights reserved.

//


#import "RootViewController.h"


@interface RootViewController ()



@property (strong, nonatomic) UIActivityIndicatorView *activityIndicator ;


@end


@implementation RootViewController


- (void)viewDidLoad {

    [super viewDidLoad];

    // Do any additional setup after loading the view.

    

    self.view.backgroundColor = [UIColor whiteColor];

    

    self.activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(100, 100, 60, 60)];

    [self.view addSubview:self.activityIndicator];

    self.activityIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;

    [self.activityIndicator startAnimating];

    

    [NSTimer scheduledTimerWithTimeInterval:3.0f target:self selector:@selector(timerStop) userInfo:nil repeats:YES];

    

    

}



- (void)timerStop

{




    [self.activityIndicator stopAnimating];





}


- (void)didReceiveMemoryWarning {

    [super didReceiveMemoryWarning];

    // Dispose of any resources that can be recreated.

}


/*

#pragma mark - Navigation


// In a storyboard-based application, you will often want to do a little preparation before navigation

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {

    // Get the new view controller using [segue destinationViewController].

    // Pass the selected object to the new view controller.

}

*/


@end


你可能感兴趣的:(iOS)