I've got a UIImageView which gets image from the camera;

- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
    image = [info objectForKey:UIImagePickerControllerOriginalImage];
    [imageView setImage:image];
    [self dismissViewControllerAnimated:YES completion:NULL];
}

How do I make it so the image does not squeeze into the UIImageview, but rather acts as a 'window' so you only see a certain section of the image, that is the size of my UIImageView?

Thanks for any help, all is appreciated!

有帮助吗?

解决方案

imageview.contentMode = UIViewContentModeCenter;

will centre the image in the view, you can adjust the size of the view then to hide or show more.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top