美文网首页
系统整理

系统整理

作者: su_19 | 来源:发表于2016-04-12 17:49 被阅读14次

  _window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
    _window.rootViewController = [[UIViewController alloc]init];
    _window.rootViewController.view.userInteractionEnabled = NO;
    //====================系统按钮============================
    UIButton *button1 = [[UIButton alloc]initWithFrame:CGRectMake(100, 100, 100, 100)];
    [_window addSubview:button1];

    //设置文字及状态
    [button1 setTitle:@"sdd" forState:UIControlStateNormal];
    //设置文字颜色及状态
    [button1 setTitleColor:[UIColor magentaColor] forState:UIControlStateNormal];
    //设置图片及状态
    [button1 setImage:[UIImage imageNamed:@"dasd"] forState:UIControlStateNormal];
    
    
    //====================View的移动============================
    UIView *view = [[UIView alloc]initWithFrame:CGRectMake(100, 500, 100, 100)];
    [_window addSubview:button1];
    view.frame = CGRectMake(1, 1, 1, 1);
    view.center = CGPointMake(1, 1);
    view.bounds = CGRectMake(0, 0, 1, 1);
    
    //旋转
    [view setTransform:CGAffineTransformMakeRotation(M_PI_2)];
    //缩放
    [view setTransform:CGAffineTransformMakeScale(1, 1)];
    //平移
    [view setTransform:CGAffineTransformMakeScale(-14, -12)];
                       
    //NSTimer scheduledTimerWithTimeInterval:<#(NSTimeInterval)#> target:<#(id)#> selector:<#(SEL)#> userInfo:<#(id)#> repeats:<#(BOOL)#>
    
    //动画
    //UIView animateWithDuration:0.3 animations:^{
    
    //}
    
    //====================UIImageView============================
    UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(100, 500, 100, 100)];
    //
    imageView.image = [UIImage imageNamed:@"baoza1_1"];
    [_window addSubview:imageView];
    
    //================显示帧动画=================
    //创建图片数组
    NSMutableArray *arrays = [[NSMutableArray alloc]init];
    for (int i = 1; i <4; i++) {
        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"dasd%d",i]];
        [arrays addObject:image];
    }
    
    //设置动画图片数组(数组元素必须是UIImage对象)
    [imageView setAnimationImages:arrays];
    
    //设置播放完一组动画所需要的时间(单位:秒)
    [imageView setAnimationDuration:1];
    //循环次数
    [imageView setAnimationRepeatCount:5];
    
    //开始动画
    [imageView startAnimating];
    //停止动画
    [imageView stopAnimating];
    
    
    _window.backgroundColor = [UIColor whiteColor];
    [_window makeKeyAndVisible];
    
    //================定时器=================
    //1.定时器的创建
    //参数1:时间间隔(定时的时间) 单位:秒
    //参数2:响应消息的对象(调用方法的对象)
    //参数3:消息(方法),可以带参数,但是只能带一个参数,而且参数的实参就是当前这个定时器对象本身
    //参数4:需要传入到定时器中的对象,一般是nil
    //参数5:是否重复
    
    //功能:repeats是NO -> 间隔1秒的时间后,[self time]; repeats是YES -> 每隔1秒self去调用time一次
    //定时器一创建就开启了
   NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(method) userInfo:nil repeats:NO];

    //暂停定时器
    [timer setFireDate:[NSDate distantFuture]];
    //开启定时器
    [timer setFireDate:[NSDate distantPast]];
    
    
    //================UITextField=================
    UITextField * textField = [[UITextField alloc] initWithFrame:CGRectMake(100, 100, 200, 60)];
    //2.添加到界面上
    [self.window addSubview:textField];
    
    //3.设置背景颜色
    textField.backgroundColor = [UIColor whiteColor];
    //============和文字相关的属性==============
    //文字
    textField.text = @"俄 sad sad";
    //文字颜色
    textField.textColor = [UIColor brownColor];
    //字体
    textField.font = [UIFont systemFontOfSize:10];
    //对齐模式
    textField.textAlignment = NSTextAlignmentCenter;
    //占位文字,(它的颜色是浅灰色,不能被改变)
    ////显示的条件是当前的text为空
    textField.placeholder = @"请输入名字";
    //6.是否在开始编辑的时候清空文字(默认是 NO)
    textField.clearsOnBeginEditing = YES;
    
    //=============和显示相关的属性===============
    //设置边框风格 Border Style
    [textField setBorderStyle:UITextBorderStyleRoundedRect];
    
    //设置清除按钮模式
    [textField setClearButtonMode:UITextFieldViewModeAlways];
    
    //设置左视图
    UILabel *leftLable = [[UILabel alloc]initWithFrame:CGRectMake(100, 100, 40, 40)];
    leftLable.text = @"账号";
    textField.leftView = leftLable;
    [textField setLeftViewMode:UITextFieldViewModeAlways];
    
    //是否处于编辑状态
    BOOL ret = textField.isEditing;
    
    

相关文章

  • 系统整理

  • 系统整理

    eureka注册中心,是一个保证AP的模型,负责服务的注册与发现,目前部署的是单节点,后续可以考虑部署为集群,保证...

  • 支付系统整理

    1.交易系统的场景 1) 下单 2)修改金额 3)退款 4)查询 5)通知 6)算费(算手续费) 2.交易系统的交...

  • 全面整理系统

    今日全面整理了乾龙式,将历日来的所得,理入原来的柜架,现下已是丰满充足。 上有大道之运行规律为依,下能付诸盘中实际...

  • 系统思维整理

    今日休息,在家做整理。近阶段的整理进入了系统的整理——从全局出发,最大程度地对物品进行分类,通过细致的安排,给...

  • 报告!我核出来了。

    系统自动整理

  • (二)永澄老师决定对第一部分进行分析阅读,构建知识体系

    1. 整理系统1和系统2的特点 2. 整理系统1和系统2的著名实验 3. 通过主动阅读找到相关扩散实验 4. 系统...

  • 系统思考的整理

    普通思考的问题 1.思考有局限,普通思考是线性的,只看树木,不见森林 2.归罪于外,总觉得自己没错,是其他原因造成...

  • 操作系统整理

    上图是硬件、软件和操作系统的关系。软件是运行在硬件上的,可以看到,硬件和软件通过操作系统来交互。 操作系统分类 1...

  • 系统思维知识整理

    1.系统思维———简单来说就是我们对待事情要站在更高层面、全方位思考,仅停留就事论事,而需要考虑整个系统来思考能力...

网友评论

      本文标题:系统整理

      本文链接:https://www.haomeiwen.com/subject/kyvilttx.html