UIActivityIndicatorView indicator provided by ios

Source: Internet
Author: User

UIActivityIndicatorView indicator provided by ios

 

//

// 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


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.