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