简体   繁体   English

如何将iPhone应用程序转换为iPad应用程序

[英]How to convert iPhone app to iPad app

I am a newbie. 我是新手。 I have an iPhone app. 我有一个iPhone应用程序。

I want to convert iPhone app to iPad app. 我想将iPhone应用程序转换为iPad应用程序。

I want to increase the size of all control, images and views according to ipad dimensions programmatically as I have no controls in XIB but infact they are programmatically made. 我想以编程方式根据ipad尺寸增加所有控件,图像和视图的大小,因为我在XIB中没有控件,但实际上它们是通过编程制作的。

I dont want to change the dimensions manually at every place because it is too much of a cumbersome work. 我不想在每个地方手动更改尺寸,因为这是一件繁琐的工作。

Is there any way I can do this in a more better way? 有什么办法可以更好地做到这一点?

Please Help. 请帮忙。

Thanks 谢谢

The simple answer is NO . 简单的答案是“否”

You have to do it manually. 您必须手动执行。 There is no automatic system. 没有自动系统。

That is the correct answer. 这是正确的答案。

if you have an absolutely trivial app - ie, with no images or controls or layouts! 如果您有一个绝对琐碎的应用-即没有图像,控件或布局! - you can of course just change it to an iPad app. -您当然可以将其更改为iPad应用程序。

The questioner is asking specifically how to change all the images, layouts, and so on in a normal app. 发问者专门询问如何在普通应用程序中更改所有图像,布局等。 The answer is it must all be done completely manually. 答案是必须全部手动完成。 There is no automatic system for re-doing design or re-doing images in Photoshop, etc. 在Photoshop等中没有自动系统可以进行重新设计或重新执行图像。

Note that similarly if you want to do both portrait and landscape layouts of an app, you or your designers have to of course simply design both layouts. 请注意,类似地,如果您想同时做一个应用程序的纵向和横向布局,则您或您的设计师当然必须简单地设计这两种布局。 There's no, say, "artificial intelligence" system that automatically does art direction for the app! 据说没有“人工智能”系统可以自动为应用程序提供艺术指导! You simply have to manually design both layouts and manually build in Photoshop all necessary images for each situation. 您只需要手动设计两种布局,并在Photoshop中手动构建每种情况的所有必要图像。 The same applies to iPad v. iPhone. iPad v。iPhone也是如此。

(Note that sometimes you will have to do four totally different layouts, and sets of graphics .. for the phone/pad and portrait/landscape.) (请注意,有时您将不得不为手机/平板电脑和人像/风景做四种完全不同的布局和图形集。)

This is exactly why iPad apps are sometimes labelled "HD" in the app store - they are of course totally different. 这正是iPad应用有时在应用商店中标记为“高清”的原因-它们当然完全不同。

In Xcode, click on your project on the "Groups & Files" sidebar. 在Xcode中,单击“组和文件”侧栏上的项目。 Press command-I. 按Command-I。 Search for Targeted Device Family and change it from iPhone to iPad. 搜索目标设备系列并将其从iPhone更改为iPad。 Then it will compile and run on an iPad but the UI might look a bit funky. 然后它将编译并在iPad上运行,但UI可能看起来有点时髦。

What I did after that was open the xib I used for my iPhone app's FlipSide view (the one that looks funky on the iPad) go to File->Create iPad version and save it as FlipSideiPad. 之后,我打开了我用于iPhone应用程序的FlipSide视图(在iPad上看起来很时髦)的xib,然后转到File-> Create iPad版本并将其另存为FlipSideiPad。

Then when I load the view controller, I used the following if statement to tell my program to load the iPhone interface if the device is an iPhone or to load the iPad interface if the device is an not an iPhone. 然后,当我加载视图控制器时,我使用以下if语句告诉我的程序,如果设备是iPhone,则加载iPhone接口;如果设备不是iPhone,则加载iPad接口。

    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
    FlipsideViewController *controller = [[FlipsideViewController alloc] initWithNibName:@"FlipsideView" bundle:nil];
    controller.delegate = self;

    controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController:controller animated:YES];
    [controller release];

}
else
{
    FlipsideViewController *controller = [[FlipsideViewController alloc] initWithNibName:@"iPadFlipsideView" bundle:nil];
    controller.delegate = self;

    controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController:controller animated:YES];
    [controller release];

}

I hope that helps. 希望对您有所帮助。

您需要手动调整视图的大小...没有将iPhone应用程序转换为iPad的单一方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM