iPhone横向模式慢 [英] iphone landscape mode slow

查看:132
本文介绍了iPhone横向模式慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在横向模式下开发的iphone应用程序正在严重变化.我将其纵向放置以进行比较,并且在该方向上看起来更加流畅.我并没有做我认为是过程密集型的工作:地图视图,一些按钮,一些标签和一些石英图,但是一些基本的石英动画会严重放慢速度.

The iphone app I am developing in landscape mode is seriously chugging. I put it in portrait for comparison and it appears to run much smoother in that orientation. I am not doing what I'd think is process intensive: a map view, some buttons, some labels, and some quartz drawing, yet some basic quartz animation seriously slows down really badly.

有人知道横向模式是否比肖像模式严重残障,和/或,是否有更好的方法来创建横向应用程序?我只需使用旋转90度的根旋转视图并将所有子视图附加到该视图即可.

Does anyone know if landscape mode is just terribly handicapped compared to portrait, and/or if so, if there are better ways to create a landscape app? I simply use a root rotated view transformed 90 degrees and attach all my sub views to it.

谢谢.

推荐答案

在渲染性能方面,横向和纵向之间应该没有真正的区别.您是否正在使用变换将主视图旋转90度?我相信,从iPhone OS 2.1开始,您不再需要手动对主视图应用转换即可使其从横向开始.我要强制横向定位的所有工作就是将此委托方法放置在我的应用程序委托中:

There should be no real difference between landscape and portrait orientations when it comes to rendering performance. Are you using a transform to rotate your main view 90 degrees? As of iPhone OS 2.1, I believe, you no longer need to manually apply a transform to your main view to get it to start in landscape. All I had to do to force landscape orientation was to place this delegate method within my application delegate:

- (void)application:(UIApplication *)application willChangeStatusBarOrientation:(UIInterfaceOrientation)newStatusBarOrientation duration:(NSTimeInterval)duration;
{
    // This prevents the view from autorotating to portrait in the simulator
    if ((newStatusBarOrientation == UIInterfaceOrientationPortrait) || (newStatusBarOrientation == UIInterfaceOrientationPortraitUpsideDown))
        [application setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
}

以及我的根视图控制器中的以下内容:

and the following in my root view controller:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{
    return ( (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight));
}

这篇关于iPhone横向模式慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆