0
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if((self.interfaceOrientation == UIDeviceOrientationLandscapeLeft) || (self.interfaceOrientation == UIDeviceOrientationLandscapeRight)){
Add1.contentStretch=CGRectMake(0.00,0.00,1024.00,66.00);
background.image = [UIImage imageNamed:@"back2-landscape.png"];
} else if((self.interfaceOrientation == UIDeviceOrientationPortrait) || (self.interfaceOrientation == UIDeviceOrientationPortraitUpsideDown)){
Add1.contentStretch=CGRectMake(0.00,0.00,768.00,66.00);
background.image = [UIImage imageNamed:@"back2-portrait.png"];
}
// Return YES for supported orientations
return YES;
}
在这段代码中,我在点方案获得EXC_BAD_ACCESS为InterfaceOrientation
if((self.interfaceOrientation == UIDeviceOrientationLandscapeLeft) || (self.interfaceOrientation == UIDeviceOrientationLandscapeRight))
得到EXC_BAD_ACCESS请告诉我为什么我收到此错误?
谢谢迪帕克。 – Lena 2011-05-27 04:10:13
但它如何在iPhone上工作呢? – 2012-03-01 03:27:06
以及如何在UIViewController中使用layoutSubviews? – 2012-03-01 03:53:55