Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有什么方法可以在设备方向动画完成之前执行代码?
现在我将自己添加为 UIDeviceOrientationDidChangeNotification 的观察者
但是,我需要在更改实际发生之前完成我的代码,而不是之后。
尝试用这种方法改变它:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); }