开发者

UIImagePickerController bottom gets cut off when I add an overlay View

Need some help on an issue that is consuming my time. It's probably something really 开发者_Python百科simple and I must be forgeting something. Here it go:

I have an UIImagePickerController in which I add a cameraOverlayView (just an ImageView). The problem is that the bottom bar gets cropped by some pixels. When I remove the overlay it works fine. I have even tried to change the overlay frame so that it fits the screen, the image is just the size of the camera viewport, but this happens even with small images. Here is some code:

UIImagePickerController* cam = [[UIImagePickerController alloc] init];

cam.sourceType = UIImagePickerControllerSourceTypeCamera; cam.delegate = self;

UIImageView *overlay = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"silhueta.png"]];
overlay.frame = CGRectMake(0, 0, [UIImage imageNamed:@"silhueta.png"].size.width, [UIImage imageNamed:@"silhueta.png"].size.height);

cam.cameraOverlayView = overlay;

[overlay release];


Try to set the contentMode of your UIImageView to i.e. UIViewContentModeCenter.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜