//
// ViewController.m
// UI1_Calayer
//
// Created by zhangxueming on 15/7/2.
// Copyright (c) 2015年 zhangxueming. All rights reserved.
// #import "ViewController.h" @interface ViewController () @end
//图层
//CALayer就是图层, 图层的功能是渲染图片和播放动画等, 每当创建一个UIView的时候,系统会自动创建一个CALayer, 但是这个CALayer对象你不能改变, 只能修改某些属性.所以通过修改CALayer,不仅可以修饰UIView的外观, 还可以给UIView添加各种动画. CALayer属于CoreAnimation框架中的类;
//CALayer 每个View都有一个CALayer属性, 每个View都附着在一个层上。
@implementation ViewController - (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];
view.backgroundColor = [UIColor redColor]; view.layer.cornerRadius = 15; view.layer.borderWidth = 10; [self.view addSubview:view]; } - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
} @end

UI1_Calayer的更多相关文章

随机推荐

  1. CSS3 Animation 基于 less 构建的 css3 动画库

    LESS动画优点 · 快速开发css3动画 · 采用less mixins写法,不会生成冗余css · 已加入主流浏览器前缀,保证最大兼容性 · LESS-Animation 部分mixins支持传参 ...

  2. Android开发代码混淆经验(Eclipse)

    为了防止自己的劳动成果被别人窃取,混淆代码能有效防止被反编译,下面来总结以下混淆代码的步骤: 2.编辑项目下的proguard-project.txt,添加不需要混淆的规则(model.泛型.反射.第 ...

  3. 【JavaScript】页面加载性能优化

    核心在于:减少加载时间 1.减少请求次数 2.缩减文件大小 3.异步加载---------------------->比如document.write 4.延迟加载.动态加载---------- ...

  4. [Angular 2] ElementRef, @ViewChild & Renderer

    ElementRef: In Angular2 Doc, it suggest to "avoid" using ElementRef. It access DOM directl ...

  5. h5-4 canvas

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  6. mongodb目录

    1. mongodb 数据库操作--备份 还原 导出 导入 2. ubuntu下mongodb启动脚本 3. mongodb实现远程连接 4. 用java在客户端读取mongodb中的数据并发送至服务 ...

  7. Linux 命令 alternatives和update-alternatives

    参考: http://lionbule.iteye.com/blog/717722 http://manpages.ubuntu.com/manpages/oneiric/man8/update-al ...

  8. keytool 错误 java.io.IOException: incorrect AVA format

    给一个APK做签名,选择新建一个key并填写相关信息,但在Finish时,keytool报出了一个错误:keytool error: java.io.IOException: Incorrect AV ...

  9. jQuery的如何捕捉回车键,改变事件标签

    我希望有一个jQuery的解决方案,我必须接近,有什么需要做的? $('html').bind('keypress', function(e) { if(e.keyCode == 13) { retu ...

  10. ansible api

    ##一个简单的python脚本,通过ansible的api调用get_url模块实现远程下载功能 #!/usr/bin/env python import json import ansible.ru ...