Commit 8fe5bc10 authored by admin's avatar admin

修复bug

parent 5e5aeefd
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
scale_ = 1.0; scale_ = 1.0;
self.view.backgroundColor = [UIColor whiteColor]; self.view.backgroundColor = [UIColor whiteColor];
self.imageScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(-20, -15, (kScreenWidth + 40), (kScreenHeight - 20))]; self.imageScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(-20, 0, (kScreenWidth + 40), (kScreenHeight - 20))];
self.imageScrollView.backgroundColor = [UIColor clearColor]; self.imageScrollView.backgroundColor = [UIColor whiteColor];
self.imageScrollView.scrollEnabled = YES; self.imageScrollView.scrollEnabled = YES;
self.imageScrollView.pagingEnabled = YES; self.imageScrollView.pagingEnabled = YES;
self.imageScrollView.delegate = self; self.imageScrollView.delegate = self;
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
[doubleTap setNumberOfTapsRequired:2]; [doubleTap setNumberOfTapsRequired:2];
UIScrollView *s = [[UIScrollView alloc] initWithFrame:CGRectMake((kScreenWidth + 40) * i, 0, (kScreenWidth + 40), (kScreenHeight - 20))]; 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), (kScreenHeight - 20));
s.contentSize = CGSizeMake((kScreenWidth + 40), 0); s.contentSize = CGSizeMake((kScreenWidth + 40), 0);
...@@ -56,6 +56,9 @@ ...@@ -56,6 +56,9 @@
[s setZoomScale:1.0]; [s setZoomScale:1.0];
UIImageView *imageview = [[UIImageView alloc] init]; UIImageView *imageview = [[UIImageView alloc] init];
[imageview setContentMode:UIViewContentModeScaleAspectFit];
if (self.pictureSaveMode == PictureLocalMode) { if (self.pictureSaveMode == PictureLocalMode) {
NSString *imageName = _allImageArray[i]; NSString *imageName = _allImageArray[i];
NSString *fullPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName]; NSString *fullPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName];
...@@ -64,18 +67,12 @@ ...@@ -64,18 +67,12 @@
} else { } else {
[imageview sd_setImageWithURL:_allImageArray[i] placeholderImage:[UIImage imageNamed:@"default_pic"]]; [imageview sd_setImageWithURL:_allImageArray[i] placeholderImage:[UIImage imageNamed:@"default_pic"]];
} }
imageview.frame = CGRectMake(20, 0, kScreenWidth, (kScreenHeight - 20)); imageview.frame = CGRectMake(20, 0, kScreenWidth, (kScreenHeight - 20));
[imageview setContentMode:UIViewContentModeScaleAspectFit];
imageview.userInteractionEnabled = YES; imageview.userInteractionEnabled = YES;
imageview.tag = i+1; imageview.tag = i+1;
[imageview addGestureRecognizer:doubleTap]; [imageview addGestureRecognizer:doubleTap];
[s addSubview:imageview]; [s addSubview:imageview];
[self.imageScrollView addSubview:s]; [self.imageScrollView addSubview:s];
......
...@@ -64,6 +64,8 @@ ...@@ -64,6 +64,8 @@
{ {
if (!_photoButton) { if (!_photoButton) {
_photoButton = [[UIButton alloc] init]; _photoButton = [[UIButton alloc] init];
_photoButton.imageView.contentMode = UIViewContentModeScaleAspectFill;
_photoButton.imageView.clipsToBounds = YES;
_photoButton.translatesAutoresizingMaskIntoConstraints = NO; _photoButton.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_photoButton]; [self.contentView addSubview:_photoButton];
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#import "AddButtonTableViewCell.h" #import "AddButtonTableViewCell.h"
#import "AddPicTextTableViewCell.h" #import "AddPicTextTableViewCell.h"
#import "CheckPicViewController.h" #import "CheckPicViewController.h"
#import "LargePictureViewController.h"
#import "HttpClient.h" #import "HttpClient.h"
#import "UIImage+Fit.h" #import "UIImage+Fit.h"
...@@ -208,9 +209,19 @@ ...@@ -208,9 +209,19 @@
- (void)showBigPic:(UIButton *)sender - (void)showBigPic:(UIButton *)sender
{ {
CheckPicViewController *checkVC = [[CheckPicViewController alloc] init]; AddPicTextTableViewCell *cell = (AddPicTextTableViewCell *)sender.superview.superview;
checkVC.checkImage = sender.imageView.image; NSIndexPath *indexPath = [_tableView indexPathForCell:cell];
[self.navigationController pushViewController:checkVC animated:YES]; 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 #pragma mark - UItextView
...@@ -442,7 +453,7 @@ ...@@ -442,7 +453,7 @@
NSString *imageName = _imageNameArray[indexPath.row - 1]; NSString *imageName = _imageNameArray[indexPath.row - 1];
NSString *fullPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName]; NSString *fullPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName];
UIImage *image = [UIImage imageWithContentsOfFile:fullPath]; 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 setImage:image00 forState:UIControlStateNormal];
[cell.photoButton removeTarget:self action:@selector(createImagePicker:) forControlEvents:UIControlEventTouchUpInside]; [cell.photoButton removeTarget:self action:@selector(createImagePicker:) forControlEvents:UIControlEventTouchUpInside];
[cell.photoButton addTarget:self action:@selector(showBigPic:) 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