swift UIActivityIndicatorView

//

//  ActivityIndicatorViewController.swift

//  UIControlDemo

//

//  Created by   on 14/12/1.

//  Copyright (c) 2014 马大哈. All rights reserved.

//

 

import UIKit

 

class ActivityIndicatorViewController: BaseViewController {

    

    var waitActivity:UIActivityIndicatorView?

    

    override func viewDidLoad() {

        super.viewDidLoad()

        self.view.backgroundColor = .redColor()

 

        waitActivity = UIActivityIndicatorView(activityIndicatorStyle: .WhiteLarge)

        waitActivity?.center = CGPointMake(self.view.frame.size.width/2, self.view.frame.size.height/2)

        self.view.addSubview(waitActivity!)

        

    }

    

    override func viewWillAppear(animated: Bool) {

        waitActivity?.startAnimating()

    }

    

    override func viewDidDisappear(animated: Bool) {

        waitActivity?.stopAnimating()

    }

 

    override func didReceiveMemoryWarning() {

        super.didReceiveMemoryWarning()

        // Dispose of any resources that can be recreated.

    }

 

}

posted on 2014-12-05 09:42  马大哈哈  阅读(322)  评论(0编辑  收藏  举报

导航