| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
jopen
9年前发布

WLCardViewLayout: Card and swipe out layout of CollectView.(可以滑动删除的卡片视图布局)

WLCardViewLayout

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

WLCardViewLayout is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "WLCardViewLayout"

支持cocoapods

pod "WLCardViewLayout"

效果

使用

在可视化编辑里:

然后关联cardlayout至Controller:

@property (weak, nonatomic) IBOutlet WLCardViewLayout *cardLayout;
- (void)viewDidLoad {  [super viewDidLoad];  [self.cardLayout setSwipeToDeleteDelegate:self];  }    //CollectView数据源代理     - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{  return 1;  }  - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{  return list.count;  }  - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{    UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"CardCell" forIndexPath:indexPath];  UIImageView *im = [cell viewWithTag:100];  [im setImage:[UIImage imageNamed:list[indexPath.section]]];  return cell;  }      //swipe删除数据源代理    -(void)swipeToDeleteLayout:(WLCardViewLayout *)layout didDeleteCellAtIndexPath:(NSIndexPath *)indexPath{  [list removeObjectAtIndex:indexPath.section];  }

Author

巫龙, 454763196@qq.com

License

WLCardViewLayout is available under the MIT license. See the LICENSE file for more info.


项目地址: https://github.com/HotWordland/WLCardViewLayout

 本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
 转载本站原创文章,请注明出处,并保留原始链接、图片水印。
 本站是一个以用户分享为主的开源技术平台,欢迎各类分享!
 本文地址:https://www.open-open.com/lib/view/open1456840543015.html
Objective-C开发 WLCardViewLayout