开发者

How Can I set UIWebview or UIWindow in Landscape Mode in Global function?

I cannot use viewcontroller because viewcontroller crushed to unity(Game engine's name)'s application somehow. I needed to make my objective-c view in landscape to match unity's display.

I have searched on internet but what I found is force setting i开发者_Go百科n controller. So I want set UIWebView or UIWindow in Landscape mode for iphone inside global function. How Can I set the code for that?


Setting a UIView or UIWindow in landscape mode is simply a matter of drawing the view in landscape orientation.

What view controllers add is simply the possibility of handling the rotation in a specific way (allowing it or preventing it), but the end responsibility to draw in landscape/portrait is with your view.

As a concrete suggestion, you can try and use a CGAffineTransformation to rotate your view, if it makes things easier for you:

    CGAffineTransform newTransform;
    newTransform = CGAffineTransformMakeRotation(M_PI/2);
    view.transform = newTransform;

but without further hints as to how your view is made up, I cannot help more.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜