- 浏览: 773833 次
- 性别:
- 来自: 天堂
最新评论
-
xiaozhao-521:
呀呀呀呀呀呀呀
RequestTest222 -
Andy_hyh:
打扰了,问下openmeeting源码可以运行起来吗?
Openmeetings安装 详细步骤 -
qindongliang1922:
擦,现在还行么,厉害
北京免费吃饭的地方 -
minixx77:
...
Openmeetings安装 详细步骤 -
wwwqqqiang:
喜欢楼主分享问题的方式,有思想
UIView 和 CALayer的那点事
文章列表
Creating Date Objects
NSTimeInterval secondsPerDay = 24 * 60 * 60;
NSDate *tomorrow = [NSDate
dateWithTimeIntervalSinceNow:secondsPerDay];
NSDate *yesterday = [NSDate
dateWithTimeIntervalSinceNow:-secondsPerDay];
To get new date objects with date-and-time values adju ...
NSScanner类参考
- 博客分类:
- objective-c
NSString *string = @"Product: Acme Potato Peeler; Cost: 0.98 73\nProduct: Chef Pierre Pasta Fork; Cost: 0.75 19\nProduct: Chef Pierre Colander; Cost: 1.27 2\n";
NSCharacterSet *semicolonSet;
NSScanner *theScanner;
NSString *PRODUCT = @"Product:";
NSString *COST = @" ...
tap是指轻触手势。类似鼠标操作的点击。从iOS 3.2版本开始支持完善的手势api:
tap:轻触
long press:在一点上长按
pinch:两个指头捏或者放的操作
pan:手指的拖动
swipe:手指在屏幕上很快的滑动
rotation:手指反向操作
这为开发者编写手势识别操作,提供了很大的方便,想想之前用android写手势滑动的代码(编写android简单的手势切换视图示例),尤其感到幸福。
这里写一个简单的tap操作。在下面视图的蓝色视图内增加对tap的识别:
当用手指tap蓝色视图的时候,打印日志输出:
代码很简单,首先要声明t ...
使用手指動態來切換UIView,意思就是說當手指頭接觸螢幕然後橫向或是縱向劃過螢幕後,就可以切換不同的畫面。關於手指動態偵測的API,主要是UIGestureRecognizer,他衍生的subclass包含,UITapGestureRecognizerUIPinchGestureRecognizerUIRotationGestureRecognizerUISwipeGestureRecognizerUIPanGestureRecognizerUILongPressGestureRecognizer以UISwipeGestureRecognizer為例,若要讓UIView具備手指動態的偵測,必須 ...
core animation pdf 文件
- (void)right {
-// photo1 is going to move to where photo2 is
NSPoint newOrigin = [photo2 frame].origin;
CABasicAnimation *animation = [self basicAnimationNamed:@"photo1" duration:1.0f];
animation.delegate = self;
[photo1 setAnimations:
[NSDictionary dictionaryWithObject:animation f ...
You change the default animation timing by setting the current animation context’s duration like this:
[NSAnimationContext beginGrouping];
[[NSAnimationContext currentContext] setDuration:2.0f];
// your code here
[NSAnimationContext endGrouping];
注意
The NSAnimationContext duration affects ...
一:Animation Timing Curves
1:Linear Animation Timing
2:Ease-In Animation Timing
3:Ease-Out Animation Timing
4:Ease-In Ease-Out Animation Timing
5:Custom Animation Timing
自定义动画执行曲线设置
We create a custom timing with the initWithControlPoints:::: method on CAMediaTimingFun ...
- (void)keyDown:(NSEvent *)event {
if(nil != [self.beach superview]) {
[[self animator] replaceSubview:self.beach with:self.snow];
} else if(nil != [self.snow superview]) {
[[self animator] replaceSubview:self.snow with:self.beach];
}
}
- (CATransition *)animation {
...
- (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame];
if (self) {
CGFloat xInset = 3.0f * (NSWidth(frame) / 8.0f);
CGFloat yInset = 3.0f * (NSHeight(frame) / 8.0f);
NSRect moverFrame = NSInsetRect(frame, xInset, yInset);
moverFrame.origin. ...
3.1 Basic Animation
CABasicAnimation
3.2 Keyframe Animations
我最近进行了一些关于关键桢动画方面的研究,感觉不错。关键桢动画其实是一个很酷的东西,因为它们会在你创建的层进行动作时给你提供更加精确的控制。基本动画 ...
Smooth Moves
you first ask mover for its animator, and you then send setFrame: to that instead.
- (void)move {
if(isRight) {
[[mover animator] setFrame:leftFramePosition];
} else {
[[mover animator] setFrame:rightFramePosition];
}
isRight = !isRi ...