UI1_Calayer
//
// 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的更多相关文章
随机推荐
- mvc cookie
Response.Cookies["userName"].Value = "ddd"; <% if (Request.Cookies[" ...
- 【JavaScript】谈谈Google Polymer以及Web UI框架的未来
摘要:开发者Axel Rauschmayer在自己的博客上详解了Google Polymer的设计理念与组成架构,深得Polymer开发者的认同.他认为Polymer这样高互操作性的设计才应该是Web ...
- iOS开发——UI篇Swift篇&玩转UItableView(三)分组功能
UItableView分组功能 class UITableViewControllerGroup: UIViewController, UITableViewDataSource, UITableVi ...
- 使用@media实现IE hack的方法
文章简介:众所周知,有些时候为了实现IE下的某些效果与现代浏览器一致,我们不得不使用一些hack手段来实现目的.比如说使用“\0”,“\”和“\9”来仅让IE某些版本识别,而对于现代浏览器来说,他会直 ...
- 获取div相对文档的位置
获取div相对文档的位置,两个方法 经测试 document.getElementById("btn").getBoundingClientRect() 在IE6下有2像素的bug ...
- c# 计算两日期的工作时间间隔(排除非工作日)及计算下一个工作时间点.
一个日期段如工作时间为 8:00 至 17:00 public class TimeHelper { /// <summary> /// 计算时间间隔 /// </summary&g ...
- 标准库 - unicode/utf8/utf8.go 解读
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a B ...
- 【PHP代码审计】 那些年我们一起挖掘SQL注入 - 8.全局防护盲点的总结下篇
0x01 背景 现在的WEB应用对SQL注入的防护基本都是判断GPC是否开启,然后使用addlashes函数对单引号等特殊字符进行转义.但仅仅使用这样的防护是存在很多盲点的,接上篇http://www ...
- ImageView的Scaletype
ImageView的Scaletype决定了图片在View上显示时的样子,如进行何种比例的缩放,及显示图片的整体还是部分,等等. 设置的方式包括: 1. 在layout xml中定义android:s ...
- 【开源项目8】Android开源项目分类汇总【畜生级别】
欢迎大家推荐好的Android开源项目,可直接Commit或在 收集&提交页 中告诉我,欢迎Star.Fork :) 微博:Trinea 主页:www.trinea.cn 邮箱:t ...