This commit is contained in:
lianxiang
2018-09-21 18:27:32 +08:00
parent f2729d343e
commit db1740e72b
573 changed files with 53631 additions and 3597 deletions
@@ -10,6 +10,9 @@
#import "MaskResultMinViewCell.h"
#import "MaskResultPercentCell.h"
#import "MaskResultShareViewCell.h"
#import "SHareTestImageVC.h"
#import "GiGaFileNanager.h"
@interface MaskTestResultVC ()
@@ -30,7 +33,8 @@
self.tableView.sectionFooterHeight = 0;
self.tableView.estimatedSectionFooterHeight= 0;
self.tableView.estimatedSectionHeaderHeight = 0;
self.tableView.frame = CGRectMake(0,0, KMainW, self.view.bounds.size.height - SAFE_NAV_HEIGHT);
//self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0,self.view.frame.size.width, 30)];
self.tableView.frame = CGRectMake(0,0,KMainW, self.view.frame.size.height);
[self.tableView registerClass:[MaskResultPercentCell class] forCellReuseIdentifier:@"MaskResultPercentCell"];
[self.tableView registerClass:[MaskResultMinViewCell class] forCellReuseIdentifier:@"MaskResultMinViewCell"];
[self.tableView registerClass:[MaskResultShareViewCell class] forCellReuseIdentifier:@"MaskResultShareViewCell"];
@@ -71,7 +75,7 @@
if (!cell) {
cell = [[MaskResultShareViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID];;
}
[cell.shareBtn addTarget:self action:@selector(shareBtnAciton) forControlEvents:UIControlEventTouchUpInside];
[cell kidTitle:self.model.mask];
return cell;
@@ -96,6 +100,42 @@
}
-(void)shareBtnAciton{
UIImage *image = [self saveLongImage:self.tableView];
// SHareTestImageVC *imagevc = [[SHareTestImageVC alloc] init];
// imagevc.image = image;
//[self.navigationController pushViewController:imagevc animated:YES];
}
- (UIImage *)saveLongImage:(UITableView *)table {
UIImage* image = nil;
// 下面方法,第一个参数表示区域大小。第二个参数表示是否是非透明的。如果需要显示半透明效果,需要传NO,否则传YES。第三个参数就是屏幕密度了,调整清晰度。
UIGraphicsBeginImageContextWithOptions(table.contentSize, YES, [UIScreen mainScreen].scale);
CGPoint savedContentOffset = table.contentOffset;
CGRect savedFrame = table.frame;
table.contentOffset = CGPointZero;
table.frame = CGRectMake(0, 0, table.contentSize.width, table.contentSize.height);
[table.layer renderInContext: UIGraphicsGetCurrentContext()];
image = UIGraphicsGetImageFromCurrentImageContext();
table.contentOffset = savedContentOffset;
table.frame = savedFrame;
UIGraphicsEndImageContext();
[[GiGaFileNanager shareInstance] saveImaeToAlBum:image];
return image;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];