Open jasanchezsa opened 10 years ago
What happens exactly? Is there no image displayed?
The Image displayed but aligment not working.
@interface OneViewController ()
@property (nonatomic, strong) UIImage *currentImage;
@end
@implementation OneViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
[self setCurrentImage:[Image of camera picker];
}
- (void)pushTwoViewController
{
TwoViewController *twoVC = [[TwoViewController alloc] initWithNibName:@"TwoViewController" bundle:nil];
[twoVC setCurrentImage:self.currentImage];
[self.navigationController pushViewController:twoVC animated:YES];
}
Second Controller:
@interface TwoViewController ()
@property (nonatomic, strong) UIImage *currentImage;
@end
@implementation TwoViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
UIImageViewAligned *imageAlign = [[UIImageViewAligned alloc] initWithFrame:CGRectMake(0, 0, 280, 280)];
[imageAlign setImage:self.currentImage];
imageAlign.contentMode = UIViewContentModeScaleAspectFit;
imageAlign.alignBottom = YES; //Not working!!!!! The image is center on UIImageView. My Image aspect ratio == UIViewContentModeScaleAspectFit
imageAlign.alignLeft = NO;
imageAlign.alignRight = NO;
imageAlign.alignTop = NO;
[self.viewContent addSubview:imageAlign];
[imageAlign setBackgroundColor:[UIColor greenColor]];
}
And I know the width and height of the image contained within the UIImageView
Hello, first congratulations for the project. Sorry for my English.
This code working:
But when I use an image in memory that comes from another UIViewController is not working:
Thank you very much.