Core Animation是一组非常强大的动画处理API,使用它能做出非常炫丽的动画效果,而且往往是事半功倍,使用它需要先添加QuartzCore.framework和引入对应的框架开发步骤:初始化一个动画对象(CAAnimation)并设置一些动画相关属性。添加动画对象到层(CALayer)中,...
分类:
其他好文 时间:
2014-10-20 23:02:27
阅读次数:
402
1.响应者对象iOS中不是任何对象都能处理事件,只有继承了UIResponder的对象才能接收并处理事件,我们称之为“响应者对象”。UIApplication、UIViewController、UIView都继承自UIResponder,因此他们都是响应者对象,都能够接收并处理事件。2.UIResp...
分类:
移动开发 时间:
2014-10-20 22:59:51
阅读次数:
353
CALayer在iOS中,看得见摸得到的东西基本都是UIView,比如button、textFild、label、icon等。UIView之所以能显示到屏幕上,完全是因为其内部的一个图层。创建UIView对象时,UIView内部会自动创建一个图层(即CALayer对象), 通过UIView的laye...
分类:
其他好文 时间:
2014-10-20 22:56:08
阅读次数:
164
navigation同理:-(UIViewController*)viewController{for(UIView*next=[selfsuperview];next;next=next.superview){UIResponder*nextResponder=[nextnextResponder];if([nextResponderisKindOfClass:[UIViewControllerclass]]){return(UIViewController*)nextResponder;}}retur..
分类:
其他好文 时间:
2014-10-20 02:14:03
阅读次数:
153
一、UIView自带有的触摸事件- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch = [touches anyObject]; if (touch.tapCount == 2)...
分类:
其他好文 时间:
2014-10-19 16:58:31
阅读次数:
210
方法一(推荐):使用CALayerCALayer *middleBorder = [CALayer layer];middleBorder.frame = CGRectMake(x, y, width, height);middleBorder.backgroundColor = UIColor.C...
分类:
其他好文 时间:
2014-10-19 16:49:32
阅读次数:
241
iOS 动画UIView动画原文:http://www.cocoachina.com/bbs/read.php?tid=1101681.概述UIKit直接将动画集成到UIView类中,实现简单动画的创建过程。UIView类定义了几个内在支持动画的属性声明,当这些属性发生改变时,视图为其变化过程提供内...
分类:
移动开发 时间:
2014-10-19 01:24:43
阅读次数:
185
AlertView.h#import @interface AlertView : UIView@property (strong, nonatomic) UILabel *messageLabel;@endAlertView.m#import "AlertView.h"@interface Ale...
分类:
其他好文 时间:
2014-10-18 01:52:05
阅读次数:
184
环境是xcode4.3首先要弄懂几个基本的概念。一)三个结构体:CGPoint、CGSize、CGRect1. CGPointC代码 /*Points.*/structCGPoint{CGFloatx;CGFloaty;};typedefstructCGPointCGPoint;/* Points....
分类:
移动开发 时间:
2014-10-17 11:37:12
阅读次数:
235
红色框框是一个uibutton_priceValueLabel是他的父视图, 必须要把button的父视图设置userInteractionEnabled = YES, button的监听才会生效!
分类:
其他好文 时间:
2014-10-16 20:40:13
阅读次数:
198