Commit 8fe5bc10 authored by admin's avatar admin

修复bug

parent 5e5aeefd
No preview for this file type
......@@ -28,8 +28,8 @@
scale_ = 1.0;
self.view.backgroundColor = [UIColor whiteColor];
self.imageScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(-20, -15, (kScreenWidth + 40), (kScreenHeight - 20))];
self.imageScrollView.backgroundColor = [UIColor clearColor];
self.imageScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(-20, 0, (kScreenWidth + 40), (kScreenHeight - 20))];
self.imageScrollView.backgroundColor = [UIColor whiteColor];
self.imageScrollView.scrollEnabled = YES;
self.imageScrollView.pagingEnabled = YES;
self.imageScrollView.delegate = self;
......@@ -43,7 +43,7 @@
[doubleTap setNumberOfTapsRequired:2];
UIScrollView *s = [[UIScrollView alloc] initWithFrame:CGRectMake((kScreenWidth + 40) * i, 0, (kScreenWidth + 40), (kScreenHeight - 20))];
s.backgroundColor = [UIColor clearColor];
s.backgroundColor = [UIColor whiteColor];
//s.contentSize = CGSizeMake((kScreenWidth + 40), (kScreenHeight - 20));
s.contentSize = CGSizeMake((kScreenWidth + 40), 0);
......@@ -56,6 +56,9 @@
[s setZoomScale:1.0];
UIImageView *imageview = [[UIImageView alloc] init];
[imageview setContentMode:UIViewContentModeScaleAspectFit];
if (self.pictureSaveMode == PictureLocalMode) {
NSString *imageName = _allImageArray[i];
NSString *fullPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName];
......@@ -64,18 +67,12 @@
} else {
[imageview sd_setImageWithURL:_allImageArray[i] placeholderImage:[UIImage imageNamed:@"default_pic"]];
}
imageview.frame = CGRectMake(20, 0, kScreenWidth, (kScreenHeight - 20));
[imageview setContentMode:UIViewContentModeScaleAspectFit];
imageview.userInteractionEnabled = YES;
imageview.tag = i+1;
[imageview addGestureRecognizer:doubleTap];
[s addSubview:imageview];
[self.imageScrollView addSubview:s];
......
......@@ -64,6 +64,8 @@
{
if (!_photoButton) {
_photoButton = [[UIButton alloc] init];
_photoButton.imageView.contentMode = UIViewContentModeScaleAspectFill;
_photoButton.imageView.clipsToBounds = YES;
_photoButton.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_photoButton];
......
......@@ -11,6 +11,7 @@
#import "AddButtonTableViewCell.h"
#import "AddPicTextTableViewCell.h"
#import "CheckPicViewController.h"
#import "LargePictureViewController.h"
#import "HttpClient.h"
#import "UIImage+Fit.h"
......@@ -208,9 +209,19 @@
- (void)showBigPic:(UIButton *)sender
{
CheckPicViewController *checkVC = [[CheckPicViewController alloc] init];
checkVC.checkImage = sender.imageView.image;
[self.navigationController pushViewController:checkVC animated:YES];
AddPicTextTableViewCell *cell = (AddPicTextTableViewCell *)sender.superview.superview;
NSIndexPath *indexPath = [_tableView indexPathForCell:cell];
NSInteger index = indexPath.row - 1;
LargePictureViewController *largeVC = [[LargePictureViewController alloc] init];
largeVC.index = index;
largeVC.pictureSaveMode = PictureLocalMode;
largeVC.allImageArray = _imageNameArray;
[self.navigationController pushViewController:largeVC animated:YES];
// CheckPicViewController *checkVC = [[CheckPicViewController alloc] init];
// checkVC.checkImage = sender.imageView.image;
// [self.navigationController pushViewController:checkVC animated:YES];
}
#pragma mark - UItextView
......@@ -442,7 +453,7 @@
NSString *imageName = _imageNameArray[indexPath.row - 1];
NSString *fullPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName];
UIImage *image = [UIImage imageWithContentsOfFile:fullPath];
UIImage *image00 = [UIImage image:image fillSize:CGSizeMake((kScreenWidth - 60) / 2, 90)];
UIImage *image00 = [UIImage image:image fillSize:CGSizeMake((kScreenWidth - 60) / 2, 110)];
[cell.photoButton setImage:image00 forState:UIControlStateNormal];
[cell.photoButton removeTarget:self action:@selector(createImagePicker:) forControlEvents:UIControlEventTouchUpInside];
[cell.photoButton addTarget:self action:@selector(showBigPic:) forControlEvents:UIControlEventTouchUpInside];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment