Fork me on GitHub
上一页 1 ··· 72 73 74 75 76 77 78 79 80 ··· 125 下一页

2012年3月6日

摘要: //该方法用于查询NQGrid对象。参数必须是NQGrid里面包含的子对象+ (NQGrid*)searchNQGridWithChild:(UIView*)childView;{ //简便方法,直接查找父页面,查找NQGrid对象。 idparent = [childViewsuperview]; while(parent && [parentisKindOfClass:[NQGridclass]]==NO) { parent = [parentsuperview]; } returnparent;}+(id)searchObjectWithChild:(UIView*)ch 阅读全文
posted @ 2012-03-06 10:47 pengyingh 阅读(133) 评论(0) 推荐(0)
摘要: 在最前边: Category得用法很方便,举例来说:新建一个Class文件, 文件名随意需要建立UIImage得Category就按照如下格式添加函数,括号内名称随意, 这种格式, 编译器即认为是一个Category@interface UIImage (xxx)@end@implementation UIImage (xxx)@end完整代码如下, 用法见附件Sample Code:@interface UIImage (Category)/** Resizes and/or rotates an image.*/- (UIImage*)transformWidth:(CGFloat)wid 阅读全文
posted @ 2012-03-06 10:38 pengyingh 阅读(281) 评论(0) 推荐(0)
摘要: 核心代码如下//暂停layer上面的动画- (void)pauseLayer:(CALayer*)layer{ CFTimeInterval pausedTime = [layer convertTime:CACurrentMediaTime() fromLayer:nil]; layer.speed = 0.0; layer.timeOffset = pausedTime;}//继续layer上面的动画- (void)resumeLayer:(CALayer*)layer{ CFTimeInterval pausedTime = [layer timeOffset]; layer.... 阅读全文
posted @ 2012-03-06 09:41 pengyingh 阅读(3459) 评论(0) 推荐(1)
摘要: [[NSFileManager defaultManager] changeCurrentDirectoryPath:[[NSBundle mainBundle] resourcePath]];文件添加,显示,导航等等等等等等等!想要的,想学的都来下载一下吧!//加载文件内容- (void) loadFileContentsIntoTextView {// open a stream to filePathNSInputStream*inputStream = [[NSInputStreamalloc]initWithFileAtPath:filePath];[inputStreamo... 阅读全文
posted @ 2012-03-06 09:38 pengyingh 阅读(167) 评论(0) 推荐(0)
摘要: 如果以下的链接有错误,或者存在其他问题。请给我发站内短信,或者发送邮件至nono.cocoa@gmail.com希望该帖对大家有帮助/************************************************IOS 类代码************************/我自己做的翻书效果,小猫咪再次登场「2011/03/02」如何实现QQLive HD界面(附代码)「2011/03/02」tabelviewcell点击设置背景图片「2011/03/02」基于UDP的聊天程序(借鉴iphone自带的短信例子)「2011/03/01」橡皮擦效果「2011/01/06」< 阅读全文
posted @ 2012-03-06 09:33 pengyingh 阅读(269) 评论(0) 推荐(0)
摘要: CGFloat radians = atan2f(self.view.transform.b, self.view.transform.a); CGFloat degrees = radians * (180 / M_PI);NSLog(@"%f %f %f", acos (MyView.transform.a), asin (MyView.transform.b), atan2(MyView.transform.b,MyView.transform.a));- (CGImageRef)CGImageRotatedByAngle:(CGImageRef)imgRef ang 阅读全文
posted @ 2012-03-06 02:59 pengyingh 阅读(546) 评论(0) 推荐(0)
摘要: //第一种动画方式- (void) first_animations{ [UIViewbeginAnimations:nilcontext:nil]; //启动动画动作 [UIViewsetAnimationRepeatCount:1];//设置是否重复播放 [UIViewsetAnimationDuration:1];//设置动画持续时间 [UIViewsetAnimationCurve:UIViewAnimationCurveEaseIn];//动画曲线,具体的应用 ,可以经过实验检测 [UIViewsetAnimationDelegate:self];//动画块的某个方法(最下方),委托 阅读全文
posted @ 2012-03-06 02:48 pengyingh 阅读(3658) 评论(0) 推荐(0)

2012年3月5日

摘要: ask:a layers position is animating from one CGPoint to an other.But I need to know the current position of the CALayer during the animation.answer:I tried for a while (I was trying to track the position to detect collisions between objects).long story short: you can't (or uptil now nobody has be 阅读全文
posted @ 2012-03-05 19:05 pengyingh 阅读(399) 评论(0) 推荐(0)

2012年3月4日

摘要: iOS提供了方便的手势API(参见编写简单的手势示例:Tap),从iOS3.2开始。在这里介绍了通过手势控制视图的示例:排列和拖动视图。但是,如果要通过手势控制子视图呢?可以在手势的delegate方法中:- (void)panPiece:(UIPanGestureRecognizer *)gestureRecognizer{ NSLog(@">>gesture….."); CGPoint location=[gestureRecognizer locationInView:self.view]; UIView *hitView=[self.view h... 阅读全文
posted @ 2012-03-04 23:48 pengyingh 阅读(676) 评论(0) 推荐(0)
摘要: 在排列和拖动视图知道如何通过手势捕获视图,在如何通过手势选择到子视图知道如何捕获视图的子视图。现在有个问题,如何通过手势捕获视图内部的层(Layer),如果能,怎么捕获。捕获到Layer是很重要的,这样才能针对具体的Layer做操作,比如拖动,比如反转等。答案是肯定的,下面写个例子说明一下。示例中的图,是在视图默认Layer下的子Layer。当touch(手指拖动)该Layer以外的部分,则只打印pan …,当在该Layer上拖动时,除了打印pan..以外,还会打印catch it!这里需要用到CALayer的hitTest方法。控制器代码很简单。头文件:@interface TestGest 阅读全文
posted @ 2012-03-04 23:45 pengyingh 阅读(720) 评论(0) 推荐(0)
上一页 1 ··· 72 73 74 75 76 77 78 79 80 ··· 125 下一页

导航