我第一次打開我的iphone會轉動按鈕。我第二次打開iPhone失敗。CGAffineTransformMakeRotation(M_PI_2)在控制檯中產生錯誤:CGAffineTransformInvert:單數矩陣
- (void)configureViewsLandscapeMode
{
UIDeviceOrientation deviceOrientation = [UIDevice currentDevice].orientation;
if (deviceOrientation == UIDeviceOrientationLandscapeLeft) {
[self.button setTransform:CGAffineTransformMakeRotation(M_PI_2)];
} else if (deviceOrientation == UIDeviceOrientationLandscapeRight) {
[self.button setTransform:CGAffineTransformMakeRotation(-M_PI_2)];
}
}
我讀別人的答案相似:
UIView scale to 0 using CGAffineTransformMakeScale
CGAffineTransformInvert: singular matrix
我開始與IOS,我不明白的問題。我想了解比擁有一個解決方案的更多的問題,我將不勝感激一些指導