文件名称:文字图片结合的滚动视图
文件大小:1.18MB
文件格式:ZIP
更新时间:2024-04-24 04:26:23
IOS源码
该源码是文字图片结合的滚动视图,源码PJR-ScrollView-Slider,PJR-ScrollView-Slider是一款结合文字+图片的滚动视图。能够左右滚动内容并且展开文字说明部分。 使用方法: 将demo中的文件夹Model,View文件夹复制到自己的项目中,并导入头文件: #import "PJRPageScrollingView.h" #import "PJRItems.h" 示例代码: - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; NSString *path = [[NSBundle mainBundle] pathForResource: @"Places" ofType:@"plist"]; NSMutableArray *placeArray = [[NSMutableArray alloc] initWithContentsOfFile:path]; NSMutableArray *array = [[NSMutableArray alloc] init]; for (int i =0 ; i < [placeArray count] ; i++){ NSDictionary *dict = [placeArray objectAtIndex:i]; PJRItems *item = [[PJRItems alloc] init]; item.itemTitle = [dict objectForKey:@"placeName"]; item.itemDesc = [dict objectForKey:@"placeDesc"]; item.itemImage = [dict objectForKey:@"placeImage"]; [array addObject:item]; } PJRPageScrollingView *pagScrollView = [[PJRPageScrollingView alloc] initWithFrame:self.view.bounds withNumberOfItems:array]; [self.view addSubview:pagScrollView]; } 使用起来比较简单,详细的请参考demo.
【文件预览】:
PJR-ScrollView-Slider-master
----Slider()
--------Slider-Info.plist(1KB)
--------main.m(337B)
--------AppDelegate.h(277B)
--------AppDelegate.m(2KB)
--------ExampleViewController.h(233B)
--------Model()
--------ExampleViewController.m(2KB)
--------Slider-Prefix.pch(344B)
--------View()
--------Images.xcassets()
--------en.lproj()
--------ExampleViewController.xib(1KB)
----images()
--------PJRSlider.gif(659KB)
----SliderTests()
--------SliderTests-Info.plist(688B)
--------en.lproj()
--------SliderTests.m(633B)
----Slider.xcodeproj()
--------project.xcworkspace()
--------project.pbxproj(23KB)
--------xcuserdata()
----README.md(2KB)