I need some help to set the bounds and frame of a UIView, I change it to a "full screen mode" by changing the bounds to "0.0f, 0.0f, 1920.0f, 1080.0f", that works, the problem I'm having is when I need to reverse the UIView back to the original bounds and frame size, but I'm having trouble setting this up. Can I get some help please?
CGRect rect = self.glView.frame;
if (!CGRectEqualToRect(self.view.frame, rect))
{
NSLog(@"Switching to Full Screen now...");
UIView *image = [_avplayController drawableView];
image.frame = CGRectMake(0.0f, 0.0f, 1920.0f, 1080.0f);
self.glView.frame = image.frame;
}
else
{
NSLog(@"Switching to Normal Screen...");
NSLog(@"Old Frame %@", NSStringFromCGRect(self.glView.frame));
NSLog(@"Old Center %@", NSStringFromCGPoint(self.glView.center));
// New Bounds and Frame size
CGRect frame = self.glView.bounds;
frame.size.height = 927.0f;
frame.size.width = 619.0f;
frame.origin.x = 931.0f;
frame.origin.y = 65.0f;
self.glView.bounds = frame;
NSLog(@"New Frame %@", NSStringFromCGRect(self.glView.frame));
NSLog(@"New Center %@", NSStringFromCGPoint(self.glView.center));
}