MPProgressIndicatorCell 1.0

MPProgressIndicatorCell 1.0

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2016年8月

Mayank Patel 维护。



 
依赖
DACircularProgress~> 2.3
SDWebImage!= 3.7.2, ~> 3.7
 

  • Mayank Patel

MPProgressViewCell

这是一个简单的 UIImageView 分类类,用于使用 SDWebImage 和 DACircleProgressView 从远程服务器下载图像

Alt

用法

MPProgressViewCell 设计用于在导航控制器中呈现。只需设置委托(必须符合 MPProgressCellDelegate

下面是实现 MPProgressViewCell 的示例代码片段。项目内也有一个简单的演示应用。

委托

   [imageview mp_setImageFromURL:URL];
   [imageview mp_setImagefromURLwithPlaceholder:URL
                               placeholderImage:[UIImage imagenamed:@"placeholder.png"]];

Table View Cell

progressCell.h

@class MPProgressCell;

@interface progressCell : UITableViewCell

@property (weak, nonatomic) IBOutlet MPProgressCell *imgView; // bind the image view with MPProgressCell Category Class

Table View Controllor

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 5;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    progressCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MPCell"
                                                     forIndexPath:indexPath];

     [cell.imgView mp_setImageFromURL:[NSURL URLWithString:@"http://farm4.static.flickr.com/3590/3329114220_5fbc5bc92b.jpg"]];

   /*  Now you can also show processing with placeholder image
     [cell.imgView mp_setImagefromURLwithPlaceholder:[NSURL URLWithString:@"http://farm4.static.flickr.com/3590/3329114220_5fbc5bc92b.jpg"] placeholderImage:[UIImage imageNamed:@"22.png"]]; */

    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 110.0f;
}

安装

MPProgressIndicatorCell 通过 CocoaPods 提供,要安装它,只需将以下行添加到您的 Podfile 中

pod "MPProgressIndicatorCell"

用法

要运行示例项目,首先从中克隆仓库,然后从 Example 目录运行 pod install

然后,将 ProgressViewCell 导入到您的源文件中(如果您使用 Swift 且不使用 CocoaPods 的框架)

#import "MPProgressCell.h"

如果您使用 Swift 且使用框架,则可以直接将浏览器导入到您的 Swift 源文件中

import MPProgressCell

作者

Mayank Patel, [email protected]

注意

最好通过 Pod 来使用这个库,

许可证

MPProgressViewCell 受 MIT 许可证的许可。更多信息请参阅 LICENSE 文件。