MRGalleryView 1.0.2

MRGalleryView 1.0.2

测试测试
语言语言 Obj-CObjective C
许可 MIT
发布最新发布2015年3月

杨军海 维护。



  • 作者
  • yangjunhai

轻量级左右滑动 View,基本实现 tableView 功能

创建方法:

glleryview = [[MRGalleryView alloc] initWithFrame:self.view.bounds];
glleryview.dataSource = self;
glleryview.delegate = self;
glleryview.pagingEnabled = YES;
glleryview.bounces = NO;
glleryview.sideBarWidth=5.0f;
glleryview.backgroundColor = [UIColor clearColor];
[self.view addSubview:glleryview];
[glleryview reloadData];

数量:

- (NSInteger)numberOfRowsInGalleryView:(MRGalleryView *)GalleryView{ 
    return 5;
}

宽度

- (CGFloat)galleryView:(MRGalleryView *)galleryView widthForRow:    (NSInteger)row{
    return self.view.frame.size.width;
}

视图

- (MRGalleryCell *)galleryView:(MRGalleryView *)galleryView cellAtRow:  (NSInteger)row{

static NSString *CellIdentifier = @"Cell";
MRGalleryCell *cell = [galleryView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[MRGalleryCell alloc] initWithIdentifier:CellIdentifier];
}else{
    //TODO: clear
}

cell.selectionType=GalleryCellSelectionTypeNone;
//TODO: 

return cell;
}

点击

- (void)galleryView:(MRGalleryView *)galleryView didSelectRow:(NSInteger)row{

}