難住這個。我正在使用這裏發佈的一段代碼將視圖旋轉到橫向。旋轉,尺寸調整和動畫效果很好,但當視圖旋轉時,狀態欄將作爲一個細小的灰色條帶掛起,這與隱藏狀態欄的大小相同。StatusBarHidden不能正常工作
下面是代碼:
[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:1.25];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];
if (self.interfaceOrientation == UIInterfaceOrientationPortrait) {
self.view.transform = CGAffineTransformIdentity;
self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(90));
self.view.bounds = CGRectMake(0.0, 0.0, 480, 320);
}
[UIView commitAnimations];
提前感謝!
這有什麼更新?看起來像iOS 7有不同的方法:http://stackoverflow.com/a/18957926/1049134 – Rivera 2014-02-26 08:57:18