views:

190

answers:

1

Hello people,

Need some help on an issue that is consuming my time. It's probably something really 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];
A: 

Hi,

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

cheers, anka

anka