zoukankan      html  css  js  c++  java
  • iOS菊花加载圈

    自定制一个继承于UIView的类然后重写initWithFrame方法;如下

    - (id)initWithFrame:(CGRect)frame

    {

        self = [super initWithFrame:frame];

        if (self) {

            // 菊花背景的大小

            self.frame = CGRectMake(kWidth/2-50, KHeight/2-50, 100, 100);

            // 菊花的背景色

            self.backgroundColor = MYCOLOR;

            self.layer.cornerRadius = 10;

            // 菊花的颜色和格式(白色、白色大、灰色)

            self.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;

            // 在菊花下面添加文字

            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 60, 80, 40)];

            label.text = @"loading...";

            label.font = [UIFont systemFontOfSize:14];

            label.textAlignment = NSTextAlignmentCenter;

            label.textColor = [UIColor whiteColor];

            [self addSubview:label];

        }

        return  self;

    }

  • 相关阅读:
    ES6解构赋值
    ES6兼容
    ES6关键字
    ES6模板字符串
    Bootstrap面试题
    Javascript中类型转换的情况以及结果
    事件
    ES6 解构赋值
    ES6 基础(let const)
    数组与字符串常用方法
  • 原文地址:https://www.cnblogs.com/sunfuyou/p/6297294.html
Copyright © 2011-2022 走看看