zoukankan      html  css  js  c++  java
  • Swift

    Swift中,除了条形进度条外,还有环形进度条,效果图如下: 


    1,环形进度条的基本属性
    (1)Style:
    Large White:比较大的白色环形进度条
    White:白色环形进度条
    Gray:灰色环形进度条 
    (2)Color:
    设置环形进度条的颜色
    (3)Behavior:
    Animating:勾选后环形进度条开始转动
    Hides When Stopped:勾选后当环形进度条停止转动时自动隐藏

    2,使用样例

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    import UIKit
     
    class ViewController: UIViewController {
     
        var activityIndicator:UIActivityIndicatorView!
         
        override func viewDidLoad() {
            super.viewDidLoad()
             
            activityIndicator = UIActivityIndicatorView(activityIndicatorStyle:
                UIActivityIndicatorViewStyle.Gray)
            activityIndicator.center=self.view.center
            self.view.addSubview(activityIndicator);
             
            play()
        }
         
        func play(){
            //进度条开始转动
            activityIndicator.startAnimating()
        }
         
        func stop(){
            //进度条停止转动
            activityIndicator.stopAnimating()
        }
         
        override func didReceiveMemoryWarning() {
            super.didReceiveMemoryWarning()
        }
    }
  • 相关阅读:
    949. Largest Time for Given Digits
    450. Delete Node in a BST
    983. Minimum Cost For Tickets
    16. 3Sum Closest java solutions
    73. Set Matrix Zeroes java solutions
    347. Top K Frequent Elements java solutions
    215. Kth Largest Element in an Array java solutions
    75. Sort Colors java solutions
    38. Count and Say java solutions
    371. Sum of Two Integers java solutions
  • 原文地址:https://www.cnblogs.com/Free-Thinker/p/4838645.html
Copyright © 2011-2022 走看看