你好,歡迎來到IOS教程網

 Ios教程網 >> IOS編程開發 >> IOS開發綜合 >> ios 系統自帶的菊花(UIActivityIndicatorView)指示器

ios 系統自帶的菊花(UIActivityIndicatorView)指示器

編輯: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


  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved