当前位置: 动力学知识库 > 问答 > 编程问答 >

iphone - Change orientation of UIWebkit based app programmatically

问题描述:

I have a UIWebkit based app. I want to change the orientation of the webkit when user clicks on a button. I am fine with reloading the html inside the webkit after changing the orientation.

Please help.

网友答案:

If I remember correctly, changing the status bar orientation will rotate the window to match the orientation defined for the status bar, even if the bar is hidden. This worked when I first tried it in iOS 4, but I have not tried it in iOS 5 at all.

Here's the command that does this:

[[UIApplication sharedApplication] setStatusBarOrientation:(UIInterfaceOrientation) animated:(BOOL)];
分享给朋友:
您可能感兴趣的文章:
随机阅读: