开发者

iPad Rotation lock problem

开发者 https://www.devze.com 2023-02-09 09:27 出处:网络
Hellow i have a question about the rotation on iPad i have search but i have not found the correct awnser.

Hellow i have a question about the rotation on iPad i have search but i have not found the correct awnser.

in the iPad app i can rotate to all interface orientations when i open a special overlay i will lock the interface orientacion to lanscape and as long as the overlay is open the application should not rotate. When i close this overlay the rotation should be e开发者_开发知识库nabled.

i hope someone can help me


Yes, you can achieve that. I have not tested this code, but I think it will work.

- (BOOL)shouldAutorotateToInterfaceOrientation(UIInterfaceOrientation)interfaceOrientation     {
// Return YES for supported orientations.
       if (showing_OVERLAY == YES) {
            return NO;
       }
  return YES;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消