kishikawakatsumi / PEPhotoCropEditor

Image cropping library for iOS.
MIT License
1.09k stars 357 forks source link

Directly set croprect to cropview. #59

Closed teffi closed 10 years ago

teffi commented 10 years ago

I'm trying to set cropview.croprect but the rect seem to ignore it meanwhile it works well if I used the controller.

What I'm trying to do is create a fix cropview regardless of what image is selected.

Here's my code:

cropView = [[PECropView alloc] initWithFrame:self.view.bounds];
cropView.image = coverPhotoView.image;
cropView.cropRect = CGRectMake(0, 0, 320, 173);
[self.view addSubview:cropView];

Anybody can help to solve this issue?

teffi commented 10 years ago

Apparently cropview initialization shall be placed on viewDidLoad block and the setting of the rect on ViewDidAppear.

Reference