zoukankan      html  css  js  c++  java
  • 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
    
  • 相关阅读:
    搬家
    围棋程序
    图论----基础知识
    贪心算法
    944. 删列造序
    1221. 分割平衡字符串
    面试题 01.01. 判定字符是否唯一
    剑指 Offer 10- II. 青蛙跳台阶问题
    面试题 16.11. 跳水板
    1137. 第 N 个泰波那契数
  • 原文地址:https://www.cnblogs.com/0515offer/p/4638528.html
Copyright © 2011-2022 走看看