| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- //
- // CommonEditorCellImg.m
- // RedAnt ERP Mobile
- //
- // Created by Ray on 11/4/15.
- // Copyright © 2015 United Software Applications, Inc. All rights reserved.
- //
- #import "CommonEditorCellImg.h"
- #import "RAUtils.h"
- #import "ImageUploadViewController.h"
- #import "ImageViewController.h"
- @implementation CommonEditorCellImg
- - (void)awakeFromNib {
- // Initialization code
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- // Configure the view for the selected state
- }
- - (IBAction)ImgButtonClicked:(UIButton *)sender {
-
- UIViewController* vc=[RAUtils getViewController :sender];
- if(self.editable==true)
- {
-
-
- ImageUploadViewController * uploadvc =[ vc.storyboard instantiateViewControllerWithIdentifier:@"ImageUploadViewController"];
-
- // UIImage* img =[self.buttonImg backgroundImageForState:UIControlStateNormal];;
-
- if(self.img_validate)
- uploadvc.img= [self.buttonImg backgroundImageForState:UIControlStateNormal];
-
- uploadvc.returnValue = ^(NSString* url_down,NSString* url_up,UIImage* img)
- {
-
- [self.buttonImg setBackgroundImage:img forState:UIControlStateNormal];
-
- if(self.imgChanged)
- self.imgChanged(url_down,url_up);
-
- };
-
- [vc.navigationController pushViewController:uploadvc animated:false];
- }
- else
- {
- ImageViewController * imagevc =[ vc.storyboard instantiateViewControllerWithIdentifier:@"ImageViewController"];
-
-
- UIImage* img=[self.buttonImg backgroundImageForState:UIControlStateNormal];
-
- if(self.img_validate)
- imagevc.image = img;//.imageView.image = [self.buttonImg backgroundImageForState:UIControlStateNormal];
-
- // uploadvc.returnValue = ^(NSString* url_down,NSString* url_up,UIImage* img)
- // {
- //
- // [self.buttonImg setBackgroundImage:img forState:UIControlStateNormal];
- //
- // if(self.imgChanged)
- // self.imgChanged(url_down,url_up);
- //
- // };
-
- [vc.navigationController pushViewController:imagevc animated:false];
- }
- // bundleVC.content_data = self.bundle_item;
-
- }
- //
- //
- //-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
- //{
- // if(self.editable==true)
- // return;
- // self.isFullScreen = !self.isFullScreen;
- // UITouch *touch = [touches anyObject];
- //
- // CGPoint touchPoint = [touch locationInView:self.contentView];
- //
- // CGPoint imagePoint = self.imageView.frame.origin;
- // //touchPoint.x ,touchPoint.y 就是触点的坐标
- //
- // // 触点在imageView内,点击imageView时 放大,再次点击时缩小
- // if(imagePoint.x <= touchPoint.x && imagePoint.x +self.imageView.frame.size.width >=touchPoint.x && imagePoint.y <= touchPoint.y && imagePoint.y+self.imageView.frame.size.height >= touchPoint.y)
- // {
- // // 设置图片放大动画
- // [UIView beginAnimations:nil context:nil];
- // // 动画时间
- // [UIView setAnimationDuration:1];
- //
- // if (self.isFullScreen) {
- // // 放大尺寸
- //
- // self.buttonImg.frame = CGRectMake(0, 0, 768, 1024);
- // }
- // else {
- // // 缩小尺寸
- // self.buttonImg.frame = CGRectMake(50, 65, 100, 100);
- // }
- //
- // // commit动画
- // [UIView commitAnimations];
- //
- // }
- //
- //}
- @end
|