Hi All,
i have an app that uses the iphone camera and puts an overlay over the camera. However it all works fine and i have managed to rotate the UIView to landscape but their is a 20px gap at the top of the view although i have set the positioning to (0,0,480,320).
starContainerView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 480.0, 320.0)] autorelease];
UIImageView *overlayViewNew = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,480.0,320.0)];
UIImage *OverlayImage = [[UIImage imageNamed:@"overlay.png"] autorelease];
overlayViewNew.image = OverlayImage;
[starContainerView addSubview:overlayViewNew];
so as you can see above i have set the UIView and set the UIIMageView and assigned a UIImage to that UIImageview and then added it to a subview of the view.
Here is the code i use to rotate the View.
- (void) accelerometer:(UIAccelerometer *)accelerometer
didAccelerate:(UIAcceleration *)acceleration {
if (fabsf(acceleration.x) > -1.0) {
CGAffineTransform landscapeTransform = CGAffineTransformMakeRotation(degreesToRadian(90));
landscapeTransform = CGAffineTransformTranslate (landscapeTransform, +80.0, +100.0);
[self.starContainerView setTransform:landscapeTransform];
}
}
I just cant seem to get it to fill that gap! Can i also say that no rocket science was involved whilst developing this but i still cant find the answer.