CALayer简单应用——隐式动画
来源:互联网 发布:淘宝保健食品类押金 编辑:程序博客网 时间:2024/05/29 13:38
#import "ViewController.h"
#define figureWidth 50
@interface ViewController ()
@property (nonatomic,strong)CALayer *graph;
@end
@implementation ViewController
- (void)viewDidLoad {
[superviewDidLoad];
self.graph = [CALayerlayer];
self.graph.bounds =CGRectMake(0,0,figureWidth,figureWidth);
self.graph.backgroundColor = [UIColorblackColor].CGColor;
self.graph.shadowColor = [UIColorgrayColor].CGColor;
self.graph.shadowOffset =CGSizeMake(3.0f,3.0f);
self.graph.shadowOpacity =0.8f;
self.graph.cornerRadius =figureWidth/2;
[self.view.layeraddSublayer:self.graph];
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touchesanyObject];
CGFloat currentWidth =self.graph.bounds.size.width;
if (currentWidth ==figureWidth) {
currentWidth = currentWidth *3;
}else{
currentWidth = figureWidth;
}
self.graph.bounds =CGRectMake(0,0, currentWidth, currentWidth);
self.graph.position = [touchlocationInView:self.view];
self.graph.cornerRadius = currentWidth/2;
}
- CALayer简单应用——隐式动画
- Calayer简单应用——下载进度条
- CALayer简单应用——渐变
- CALayer简单应用 —— 阴影
- 动画—CALayer的初步学习一:CALayer属性—隐式动画(学会从博客上自学)
- iOS CALayer 隐式动画
- iOS CALayer隐式动画
- CALayer的隐式动画
- CALayer 的隐式动画
- XMG CALayer隐式动画
- CALayer关闭隐式动画
- CALayer简单应用——带阴影的icon
- CALayer简介 (七)CALayer的隐式动画属性
- CALayer的简单应用
- CALayer简单的时钟动画
- iOS —— CALayer 层的属性及隐式动画
- iOS开发UI篇—CAlayer层的属性(position、anchorPoint) 和隐式动画
- iOS开发UI篇—CAlayer层的属性(layer的隐式动画)
- 123
- httpClient封装——异步、回调、下载
- JavaEE_Mybatis_Mybaits 的 Mapper.xml中不能出现<(小于)符号
- LoadRunner11对Java项目中类及其他相关jar包的引用
- Eclipse中mahout运行环境的搭建以及推荐实例
- CALayer简单应用——隐式动画
- VS 和Visual Assist X快捷键
- Git 提示fatal: remote origin already exists 错误解决办法
- matlab中的fftshift
- MATLAB中的wavedec、wrcoef函数简析
- Mahout机器学习平台之聚类算法详细剖析(含实例分析)
- 在使用JQuery插件时报错:TypeError:$.browser is undefined的解决方法
- java多线程之--多的生产者与多个消费者
- java libs调试