我使用下面的代碼更改的UIImageView的圖像時,iPad的方向改變改變UIImagView圖像時的iPad改變其方向
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
if((self.interfaceOrientation == UIDeviceOrientationLandscapeLeft) || (self.interfaceOrientation == UIDeviceOrientationLandscapeRight))
{
self.background=self.background_D;
self.backgroundImage.backgroundColor = [UIColor colorWithPatternImage:self.background];
}
else if((self.interfaceOrientation == UIDeviceOrientationPortrait) || (self.interfaceOrientation == UIDeviceOrientationPortraitUpsideDown))
{
self.background=self.background_P;
self.backgroundImage.backgroundColor = [UIColor colorWithPatternImage:self.background];
}
}
一切工作正常,當我改變方向需要停頓了一秒鐘,除然後改變圖像。同時它以平鋪格式顯示相同的舊圖像。我該怎麼做才能避免這種情況?
薩米特
試過還是面臨同樣的問題:P – slonkar