当前位置: 首页 > 科技观察

仿Instagram风格滚动查看源码下载

时间:2023-03-21 15:57:01 科技观察

功能分类:其他支持平台:iOS运行环境:iOS开发语言:Object-c开发工具:Xcode源代码大小:3.64MB源代码简介:类似于Instagram和20lines的滚动效果。源码运行截图:源码片段-(void)loadGraphics{imgCropped=nil;self.view.backgroundColor=[UIColorwhiteColor];//settheimageofthetemplateif(kHeight>480){imageViewTemplate=[[PFImageViewalloc]initWithFrame:CGRectMake(kWidth/2-85,20,170,255)];}else{imageViewTemplate=[[PFImageViewalloc]initWithFrame:CGRectMake(kWidth/2-60,20,120,180)];}[imageViewTemplatesetImage:[UIImageimageNamed:@"copertina1"]];[self.viewaddSubview:imageViewTemplate];//setthetemplatesviewatthebottomtemplatesView=[[PFTemplatesViewControlleralloc]init];templatesView.view.frame=CGRectMake(0,kHeight-264,kWidth,264);templatesView.imgCover=_imgChosen;[templatesViewloadGraphics];templatesView.scrollTemplatesView.delegate[self=self.viewaddSubview:templatesView.view];templateNumber=0;templateColor=rgb2Color(255,255,255);}-(void)templateCreated:(UIImage*)imgTemplateandNumber:(NSInteger)numberTemplateandColor复制代码:(UIColor*)colorTemplate{templateNumber=numberTemplate;templateColor=colorTemplate;[imageViewTemplatesetImage:imgTemplate];CATransition*transition=[CATransitionanimation];transition.duration=0.3f;transition.timingFunction=[CAMediaTimingFunctionfunctionWithName:kCAMediaTimingFunctionEaseInEaseOut];transition.type=kCATransitionFade;[imageViewTemplate.layeraddAnimation:transitionforKey:nil];}源码下载地址:http://down.51cto.com/data/1963010