DHSmartScreenshot 1.3.1

DHSmartScreenshot 1.3.1

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
发布最新发布2015年2月

David Hernandez 维护。



  • David Hernandez

UITableView/UIScrollView 分类为你提供真正简单、智能、瞬时的截图图像,适用于 iOS 5+ 设备。

截图

这是一个在模拟器上的 tableview

iOS TableView on Simulator

这里是通过选择第一行获得的全屏截图图像

Screenshot Taken - Example

安装

  1. 首选的安装方式是通过 Cocoapods。只需添加以下内容到你的 Podfile 并运行 pod install
pod 'DHSmartScreenshot'

这将安装最佳版本的 DHSmartScreenshot。

或者你还可以将 Classes/ 目录下的所有文件复制到你的项目中。确保已勾选 '将项目复制到目标文件夹的文件夹中'。

使用

  1. 导入头文件: #import "DHSmartScreenshot.h"

  2. 调用

UIImage * tableViewScreenshot = [self.tableView screenshot];

以获取你的 tableView 实例的完整截图,或者查看以下内容以了解要调用的方法以及获取更符合你需求的定制截图。

方法

有一些方法可以自定义截图的方式。每个方法都是自我描述性的,并且按预期工作,请参阅

- (UIImage *)screenshot;
- (UIImage *)screenshotOfCellAtIndexPath:(NSIndexPath *)indexPath;
- (UIImage *)screenshotOfHeaderViewAtSection:(NSUInteger)section;
- (UIImage *)screenshotOfFooterViewAtSection:(NSUInteger)section;
- (UIImage *)screenshotExcludingAllHeaders:(BOOL)withoutHeaders
                       excludingAllFooters:(BOOL)withoutFooters
                          excludingAllRows:(BOOL)withoutRows;
- (UIImage *)screenshotExcludingHeadersAtSections:(NSSet *)headerSections
                       excludingFootersAtSections:(NSSet *)footerSections
                        excludingRowsAtIndexPaths:(NSSet *)indexPaths;
- (UIImage *)screenshotOfHeadersAtSections:(NSSet *)headerSections
                         footersAtSections:(NSSet *)footerSections
                          rowsAtIndexPaths:(NSSet *)indexPaths;
- (UIImage *)screenshotOfVisibleContent;

贡献

当然 :) 请发送一个 pull-request 或提出一个问题。了解如何改进事情总是很好的,耶!

作者

David Hernandez ([email protected])

许可证

DHSmartScreenshot 在 MIT 许可证下。