如何使在iPhone 5上运行的应用适合iPhone 4和iPhone 3的屏幕 [英] How do i make an app running on iphone 5 fit the screen of iphone 4 and 3

查看:95
本文介绍了如何使在iPhone 5上运行的应用适合iPhone 4和iPhone 3的屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在Iphone 5上运行的应用程序,并且所有元素都非常合适,我想在Iphone 3和Iphone 4上也运行该应用程序.

I have a an app running on Iphone 5 and all the elements fit perfectly, I want to run the app also on Iphone 3 and Iphone 4.

我阅读了一些有关自动调整大小的文章,但是找不到有关此问题的任何特定信息.

I read a few articles about the Auto Sizing but I could not find any information specific for this issue.

我需要多个尺寸不同的图像吗? 我需要按语法设置元素的大小吗?

Do I need to have a multiple Images with different sizes? Do I need to set the elements size grammatically ?

任何帮助人员....

谢谢.

推荐答案

  • 您需要有多个具有不同大小的图像.
  • 您需要在viewWillApear方法中以编程方式设置元素大小.
  • -(void)viewWillAppear:(BOOL)animated
    {
        if ([[UIScreen mainScreen] bounds].size.height == 568)
        {
            [splashImage setFrame:CGRectMake(0, 0, 320, 548)];
            [splashImage setImage:[UIImage imageNamed:@"splash_Image_320X568@2x.jpg"]];
        }
        else
        {
            [splashImage setFrame:CGRectMake(0, 0, 320, 460)];
            [splashImage setImage:[UIImage imageNamed:@"splash_Image_320X.jpg"]];
        }
    }
    

    这篇关于如何使在iPhone 5上运行的应用适合iPhone 4和iPhone 3的屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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