博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2013年4月15日

摘要: - (IBAction)btn_ModuleClicked:(id)sender { {// NSLog(@"%@",self.videoContainer); if (YES) { VideoViewController *videoViewController = [[VideoViewController alloc] initWithNibName:@"VideoViewController" bundle:nil]; CGRect frame = videoViewControlle... 阅读全文

posted @ 2013-04-15 15:50 酸梅拯救地球 阅读(124) 评论(0) 推荐(0)

2013年4月13日

摘要: [CATransactionbegin][CATransactionsetValue:[NSNumbernumberWithFloat:5.0f]forKey:kCATransactionAnimationDuration][layersetBounds:bounds];[CATransactioncommit];会不会setBounds时会执行默认动画的时间??? CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@”position”]; [animat... 阅读全文

posted @ 2013-04-13 22:42 酸梅拯救地球 阅读(134) 评论(0) 推荐(0)

2013年4月11日

摘要: You need a delegate that implementsUIScrollViewDelegateand is set todelegateon yourUIScrollViewinstanceOn your delegate you have to implement one method:viewForZoomingInScrollView:(which must return the content view you're interested in zooming). You can also implementscrollViewDidEndZooming:wit 阅读全文

posted @ 2013-04-11 17:23 酸梅拯救地球 阅读(272) 评论(0) 推荐(0)

2013年4月9日

摘要: Combine two UIImagesTo add two UIImages together you need to make use of Graphics Context.- (UIImage *)addImage:(UIImage *)image1 toImage:(UIImage *)image2 { UIGraphicsBeginImageContext(image1.size); // Draw image1 [image1 drawInRect:CGRectMake(0, 0, image1.size.width, image1.size.h... 阅读全文

posted @ 2013-04-09 11:07 酸梅拯救地球 阅读(190) 评论(0) 推荐(0)

摘要: 1.if you specify a path with a call to –setPath, anything specified in the values field with a call to –setValues will be ignored. 2. 阅读全文

posted @ 2013-04-09 11:05 酸梅拯救地球 阅读(160) 评论(0) 推荐(0)

2013年4月8日

摘要: If you are using a UIImageView to display the image you can simply do the following:imageView.layer.cornerRadius =5.0;imageView.layer.masksToBounds = YES;And to add a border:imageView.layer.borderColor =[UIColor lightGrayColor].CGColor;imageView.layer.borderWidth =1.0;I believe that you'll have 阅读全文

posted @ 2013-04-08 17:21 酸梅拯救地球 阅读(153) 评论(0) 推荐(0)

2013年3月23日

摘要: 转自 http://hi.baidu.com/feng20068123/item/275eb5c2d9bf0a68f6c95d63Apple的例程Reachability中介绍了取得/检测网络状态的方法。在你的程序中使用Reachability只须将该例程中的Reachability.h和Reachability.m拷贝到你的工程中。如下图:然后将SystemConfiguration.framework添加进工程:Reachability中定义了3种网络状态。//thenetworkstateofthedeviceforReachability1.5.typedefenum{NotReach 阅读全文

posted @ 2013-03-23 20:38 酸梅拯救地球 阅读(191) 评论(0) 推荐(0)

2013年3月21日

摘要: 1 -(void)drawInContext:(CGContextRef)context 2 { 3 // Drawing with a white stroke color 4 CGContextSetRGBStrokeColor(context, 1.0, 1.0, 1.0, 1.0); 5 // Drawing with a blue fill color 6 CGContextSetRGBFillColor(context, 0.0, 0.0, 1.0, 1.0); 7 // Draw them with a 2.0 stroke width ... 阅读全文

posted @ 2013-03-21 16:38 酸梅拯救地球 阅读(191) 评论(0) 推荐(0)

2013年3月20日

摘要: 1 static MyGizmoClass *sharedGizmoManager = nil; 2 3 + (MyGizmoClass*)sharedManager 4 { 5 if (sharedGizmoManager == nil) { 6 sharedGizmoManager = [[super allocWithZone:NULL] init]; 7 } 8 return sharedGizmoManager; 9 }10 11 + (id)allocWithZone:(NSZone *)zone12 {13 return [... 阅读全文

posted @ 2013-03-20 13:00 酸梅拯救地球 阅读(245) 评论(0) 推荐(0)

2013年3月17日

摘要: #include <math.h>#define pi 3.14159265358979323846#define degreesToRadian(x) (pi * x / 180.0)#define radiansToDegrees(x) (180.0 * x / pi)CGFloat distanceBetweenPoints (CGPoint first, CGPoint second) {CGFloat deltaX = second.x - first.x;CGFloat deltaY = second.y - first.y;return sqrt(deltaX*del 阅读全文

posted @ 2013-03-17 22:24 酸梅拯救地球 阅读(644) 评论(0) 推荐(0)