我如何能轻松地制作iPhone的发射图像?

时间:2022-05-10 20:52:04

According to Apple's guide line, an iPhone app's launch image/splash screen should be a prerendered static image that looks similar to the application's first screen.

根据苹果公司的指导方针,iPhone应用程序的启动图像/启动屏幕应该是预先录制的静态图像,看起来与应用程序的第一个屏幕类似。

Here are some links to Apple's documentations about this:

以下是苹果公司相关文件的链接:

1) Launch images, iOS human interface guideline:

1)启动图像,iOS人机界面指南:

https://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/MobileHIG/IconsImages/IconsImages.html#//apple_ref/doc/uid/TP40006556-CH14-SW5

https://developer.apple.com/library/ios/文档/用户体验/概念/ MobileHIG / IconsImages IconsImages.html # / / apple_ref / doc / uid / TP40006556-CH14-SW5

2) App Launch (Default) Images, iOS app programming guide:

2) App启动(默认)图片,iOS App编程指南:

https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/App-RelatedResources/App-RelatedResources.html#//apple_ref/doc/uid/TP40007072-CH6-SW12

https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/App-RelatedResources/App-RelatedResources.html / / apple_ref / doc / uid / TP40007072-CH6-SW12

I just wonder how can I create such launch image easily. In most cases, it seems the launch image should be a combination of empty status bar + navigation bar + empty table/view + tab bar, and each of them should be rendered with iOS's predefined color scheme.

我只是想知道如何才能轻松创建这样的发射图像。在大多数情况下,启动图像应该是空状态栏+导航栏+空表/视图+选项卡栏的组合,每一个都应该使用iOS预定义的颜色方案进行渲染。

But I cannot find any documentation about how I should do this and cannot find any entry in Xcode which seems related with this. Is there any Apple's official tool to render the launch image easily? Or do all the app developers simply use some mockup iPhone controls + Photoshop to do this?

但是我找不到任何关于我该如何做这个的文档,并且在Xcode中找不到任何与此相关的条目。有什么苹果的官方工具可以轻松渲染发布图像吗?还是所有的应用程序开发者都只是用一些iPhone控件+ Photoshop来做这个?

Any help is appreciated. Thanks.

任何帮助都是感激。谢谢。

9 个解决方案

#1


14  

It would not be much of a problem, do compose a static XIB file of your main screen (empty tab bar, empty navigation bar) or whatsoever. Just the backgrounds without any elements or labels placed on them.

这并不是什么大问题,您可以为主屏幕(空标签栏、空导航栏)编写一个静态的XIB文件。没有任何元素或标签的背景。

You can launch this "empty" application in the iPhone Simulator which has a built-in screenshot function. With additional software like the iPhone Simulator Cropper you can crop the image to the preferred size.

您可以在iPhone模拟器中启动这个“空”应用程序,它具有内置的屏幕截图功能。使用其他软件,如iPhone模拟器Cropper,你可以裁剪图片到你喜欢的大小。

That would be my approach to do this.

这就是我的方法。

#2


7  

Since I find it cumbersome to remove content in the nib file I use a code approach.

由于我发现删除nib文件中的内容很麻烦,所以我使用代码方法。

The code is different for each project. But you'll get the idea.

每个项目的代码都是不同的。但你会明白的。

// uncomment to take a screenshot for the launch image
//#define SCREENSHOTMODE 

- (void)viewDidLoad {
    [super viewDidLoad];
    /* regular stuff */
#ifdef SCREENSHOTMODE
        self.navigationItem.leftBarButtonItem = nil;
        self.navigationItem.rightBarButtonItem = nil;
        self.title = nil;
        [self deactivateContentForSubviewsInView:self.view];
#endif
}


#ifdef SCREENSHOTMODE
- (void)deactivateContentForSubviewsInView:(UIView *)contentView {
    for (UIView *aView in contentView.subviews) {
        if ([aView isKindOfClass:[UILabel class]]) {
            [(UILabel *)aView setText:nil];
        }
        else if ([aView isKindOfClass:[UITableView class]]) {
            [(UITableView *)aView setDataSource:nil];
        }
        else if ([aView isKindOfClass:[UIToolbar class]]) {
            [(UIToolbar *)aView setItems:nil];
        }
        else if ([aView isKindOfClass:[UIImageView class]]) {
            [(UIImageView *)aView setImage:nil];
        }
        else if ([aView isKindOfClass:[UIView class]]) {
            // i often put views in UIViews to group them
            [self deactivateContentForSubviewsInView:aView];
        }
    }
}
#endif

If you only have a handful of objects you can just remove the content of your UI-elements directly. Without loops.

如果只有少数对象,可以直接删除ui元素的内容。没有循环。

#3


7  

It seems there is no such tool built in Xcode for this. I ended up with a method just like Sebastian Wramba said above with a little difference. I used Xcode 4.2 storyboarding for UI design of my app, here is my steps to do this in Xcode 4.2 storyboard:

在Xcode中似乎没有这样的工具。最后我找到了一种方法,就像Sebastian Wramba上面说的那样,只是略有不同。我在app的UI设计中使用了Xcode 4.2故事板,在Xcode 4.2故事板中,我的步骤如下:

  1. Drag an empty view controller from the "Object library" to the storyboard

    将空视图控制器从“对象库”拖到故事板

  2. Add empty navigation bar/table view/tab bar/other components to the new scene above according to your initial screen layout

    根据您最初的屏幕布局,向上面的新场景添加空导航条/表格视图/标签栏/其他组件

  3. Click the view controller in the storyboard, in the "Attributes Inspector" of the view controller, there is a checkbox called "Initial Scene: Is Initial View Controller". Check that.

    单击故事板中的视图控制器,在视图控制器的“属性检查器”中,有一个名为“初始场景:是初始视图控制器”的复选框。检查。

  4. Launch the app in Xcode, your app's initial screen will be set to the one you just created. Take a screenshot and use that as the launch image.

    在Xcode中启动应用程序,应用程序的初始屏幕将设置为您刚刚创建的屏幕。取一个截屏,并使用它作为发射图像。

  5. Set the initial scene back to your real initial scene by checking its "Initial Scene" checkbox.

    通过检查“初始场景”复选框,将初始场景设置为真实的初始场景。

I will still mark Sebastian Wramba's solution as the answer to my question since the general idea is the same, just create a dedicated UI in Xcode for it.

我仍然将Sebastian Wramba的解决方案作为我的问题的答案,因为总体思路是相同的,只需在Xcode中为它创建一个专用的UI。

#4


1  

The easiest solution for your needs - launch your application, take a screenshot of the initial state (home+power button on the device), and voila! You have yourself a nice png file containing your initial app state with Apple's color scheme as needed.

满足您的需求的最简单的解决方案——启动您的应用程序,获取初始状态的屏幕快照(设备上的home+power按钮),瞧!你有一个不错的png文件,其中包含了你最初的应用状态和苹果的配色方案。

#5


1  

I ifdef out my data source in a debug build so the app starts up empty, then build and run it, and take a screenshot of the empty app. To suggest that the user wait a bit, I might use photoshop to overlay my trademark image or some splash logos partially blocking the most obvious control. If it's an entertaining app, I might also animate a copy of those logo icons away when the app starts running.

我ifdef数据源在调试构建应用程序启动空,然后构建和运行它,并采取空应用程序的一个屏幕快照。表明用户等一段时间,我可能会使用photoshop覆盖我的商标图像或一些飞溅标识部分阻塞最明显的控制。如果是一个有趣的应用程序,我也可以在应用程序开始运行时把这些图标的拷贝动画化。

#6


0  

Easier even than that. Pull up the image you want to put as your splash screen on your phone. Save the image to your camera roll. Open the image in your camera roll. Tap on the image to get a full screen view. Take a screen shot. Send that image, via email to your computer. Change the ending of the file from PNG to png, it sucks I know :) Add the image to your Launch Image area. Walla! ;)

甚至比这更容易。把你想要放在你手机上的飞溅屏幕上的图像拉出来。将图像保存到相机胶卷上。打开你的相机胶卷。点击图像以获得全屏视图。屏幕截图。通过电子邮件发送图片到你的电脑。将文件的结尾从PNG更改为PNG,我知道很糟糕)将图像添加到您的发射图像区域。要人!,)

#7


0  

You can use iOS 8 launch screen XIBs to generate static launch images using the simulator, which you may have to do if you're supporting iOS 7 or earlier.

您可以使用ios8启动屏幕XIBs来使用模拟器生成静态启动映像,如果您支持ios7或更早的版本,您可能需要这样做。

  1. Create a launch screen XIB.
  2. 创建一个启动屏幕XIB。
  3. Select the project itself in Xcode's project navigator and then under General > Deployment Info change the Main Interface field to your launch screen XIB. This step will leave the launch screen XIB in the Simulator so you have time to take a screen shot in step 4.
  4. 在Xcode的项目导航器中选择项目本身,然后在一般的>部署信息下将主界面字段更改为启动屏幕XIB。这一步将在模拟器中离开发射屏幕XIB,因此您有时间在步骤4中拍摄屏幕快照。
  5. Start your application in the Simulator.
  6. 在模拟器中启动应用程序。
  7. Once your launch screen appears in the Simulator, select File > Save Screen Shot.
  8. 一旦启动屏幕出现在模拟器中,选择File >保存屏幕截图。

Repeat this process for each device you need to support. You may have to use an image editor to remove the status bar from the screen shot.

对需要支持的每个设备重复此过程。您可能需要使用图像编辑器从屏幕快照中删除状态栏。

#8


0  

If you need a simple launch screen with a navigation bar and a tab bar for example, my suggestion is to use launch files. In iOS 8 and later, you can create a XIB or storyboard file instead of a static launch image.

如果您需要一个带有导航栏和标签栏的简单启动屏幕,我的建议是使用启动文件。在ios8和以后的版本中,您可以创建一个XIB或故事板文件,而不是静态的启动映像。

You can read more about that in the next link: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/LaunchImages.html

您可以在下一个链接中阅读更多:https://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/launchimage .html

#9


0  

I Set all the above. however it didn't work when debugging again. I remove the app from the simulator and iPhone and worked straight away

以上都是我设定的。但是,当再次调试时,它没有工作。我从模拟器和iPhone上删除了这个应用程序,然后直接工作。

#1


14  

It would not be much of a problem, do compose a static XIB file of your main screen (empty tab bar, empty navigation bar) or whatsoever. Just the backgrounds without any elements or labels placed on them.

这并不是什么大问题,您可以为主屏幕(空标签栏、空导航栏)编写一个静态的XIB文件。没有任何元素或标签的背景。

You can launch this "empty" application in the iPhone Simulator which has a built-in screenshot function. With additional software like the iPhone Simulator Cropper you can crop the image to the preferred size.

您可以在iPhone模拟器中启动这个“空”应用程序,它具有内置的屏幕截图功能。使用其他软件,如iPhone模拟器Cropper,你可以裁剪图片到你喜欢的大小。

That would be my approach to do this.

这就是我的方法。

#2


7  

Since I find it cumbersome to remove content in the nib file I use a code approach.

由于我发现删除nib文件中的内容很麻烦,所以我使用代码方法。

The code is different for each project. But you'll get the idea.

每个项目的代码都是不同的。但你会明白的。

// uncomment to take a screenshot for the launch image
//#define SCREENSHOTMODE 

- (void)viewDidLoad {
    [super viewDidLoad];
    /* regular stuff */
#ifdef SCREENSHOTMODE
        self.navigationItem.leftBarButtonItem = nil;
        self.navigationItem.rightBarButtonItem = nil;
        self.title = nil;
        [self deactivateContentForSubviewsInView:self.view];
#endif
}


#ifdef SCREENSHOTMODE
- (void)deactivateContentForSubviewsInView:(UIView *)contentView {
    for (UIView *aView in contentView.subviews) {
        if ([aView isKindOfClass:[UILabel class]]) {
            [(UILabel *)aView setText:nil];
        }
        else if ([aView isKindOfClass:[UITableView class]]) {
            [(UITableView *)aView setDataSource:nil];
        }
        else if ([aView isKindOfClass:[UIToolbar class]]) {
            [(UIToolbar *)aView setItems:nil];
        }
        else if ([aView isKindOfClass:[UIImageView class]]) {
            [(UIImageView *)aView setImage:nil];
        }
        else if ([aView isKindOfClass:[UIView class]]) {
            // i often put views in UIViews to group them
            [self deactivateContentForSubviewsInView:aView];
        }
    }
}
#endif

If you only have a handful of objects you can just remove the content of your UI-elements directly. Without loops.

如果只有少数对象,可以直接删除ui元素的内容。没有循环。

#3


7  

It seems there is no such tool built in Xcode for this. I ended up with a method just like Sebastian Wramba said above with a little difference. I used Xcode 4.2 storyboarding for UI design of my app, here is my steps to do this in Xcode 4.2 storyboard:

在Xcode中似乎没有这样的工具。最后我找到了一种方法,就像Sebastian Wramba上面说的那样,只是略有不同。我在app的UI设计中使用了Xcode 4.2故事板,在Xcode 4.2故事板中,我的步骤如下:

  1. Drag an empty view controller from the "Object library" to the storyboard

    将空视图控制器从“对象库”拖到故事板

  2. Add empty navigation bar/table view/tab bar/other components to the new scene above according to your initial screen layout

    根据您最初的屏幕布局,向上面的新场景添加空导航条/表格视图/标签栏/其他组件

  3. Click the view controller in the storyboard, in the "Attributes Inspector" of the view controller, there is a checkbox called "Initial Scene: Is Initial View Controller". Check that.

    单击故事板中的视图控制器,在视图控制器的“属性检查器”中,有一个名为“初始场景:是初始视图控制器”的复选框。检查。

  4. Launch the app in Xcode, your app's initial screen will be set to the one you just created. Take a screenshot and use that as the launch image.

    在Xcode中启动应用程序,应用程序的初始屏幕将设置为您刚刚创建的屏幕。取一个截屏,并使用它作为发射图像。

  5. Set the initial scene back to your real initial scene by checking its "Initial Scene" checkbox.

    通过检查“初始场景”复选框,将初始场景设置为真实的初始场景。

I will still mark Sebastian Wramba's solution as the answer to my question since the general idea is the same, just create a dedicated UI in Xcode for it.

我仍然将Sebastian Wramba的解决方案作为我的问题的答案,因为总体思路是相同的,只需在Xcode中为它创建一个专用的UI。

#4


1  

The easiest solution for your needs - launch your application, take a screenshot of the initial state (home+power button on the device), and voila! You have yourself a nice png file containing your initial app state with Apple's color scheme as needed.

满足您的需求的最简单的解决方案——启动您的应用程序,获取初始状态的屏幕快照(设备上的home+power按钮),瞧!你有一个不错的png文件,其中包含了你最初的应用状态和苹果的配色方案。

#5


1  

I ifdef out my data source in a debug build so the app starts up empty, then build and run it, and take a screenshot of the empty app. To suggest that the user wait a bit, I might use photoshop to overlay my trademark image or some splash logos partially blocking the most obvious control. If it's an entertaining app, I might also animate a copy of those logo icons away when the app starts running.

我ifdef数据源在调试构建应用程序启动空,然后构建和运行它,并采取空应用程序的一个屏幕快照。表明用户等一段时间,我可能会使用photoshop覆盖我的商标图像或一些飞溅标识部分阻塞最明显的控制。如果是一个有趣的应用程序,我也可以在应用程序开始运行时把这些图标的拷贝动画化。

#6


0  

Easier even than that. Pull up the image you want to put as your splash screen on your phone. Save the image to your camera roll. Open the image in your camera roll. Tap on the image to get a full screen view. Take a screen shot. Send that image, via email to your computer. Change the ending of the file from PNG to png, it sucks I know :) Add the image to your Launch Image area. Walla! ;)

甚至比这更容易。把你想要放在你手机上的飞溅屏幕上的图像拉出来。将图像保存到相机胶卷上。打开你的相机胶卷。点击图像以获得全屏视图。屏幕截图。通过电子邮件发送图片到你的电脑。将文件的结尾从PNG更改为PNG,我知道很糟糕)将图像添加到您的发射图像区域。要人!,)

#7


0  

You can use iOS 8 launch screen XIBs to generate static launch images using the simulator, which you may have to do if you're supporting iOS 7 or earlier.

您可以使用ios8启动屏幕XIBs来使用模拟器生成静态启动映像,如果您支持ios7或更早的版本,您可能需要这样做。

  1. Create a launch screen XIB.
  2. 创建一个启动屏幕XIB。
  3. Select the project itself in Xcode's project navigator and then under General > Deployment Info change the Main Interface field to your launch screen XIB. This step will leave the launch screen XIB in the Simulator so you have time to take a screen shot in step 4.
  4. 在Xcode的项目导航器中选择项目本身,然后在一般的>部署信息下将主界面字段更改为启动屏幕XIB。这一步将在模拟器中离开发射屏幕XIB,因此您有时间在步骤4中拍摄屏幕快照。
  5. Start your application in the Simulator.
  6. 在模拟器中启动应用程序。
  7. Once your launch screen appears in the Simulator, select File > Save Screen Shot.
  8. 一旦启动屏幕出现在模拟器中,选择File >保存屏幕截图。

Repeat this process for each device you need to support. You may have to use an image editor to remove the status bar from the screen shot.

对需要支持的每个设备重复此过程。您可能需要使用图像编辑器从屏幕快照中删除状态栏。

#8


0  

If you need a simple launch screen with a navigation bar and a tab bar for example, my suggestion is to use launch files. In iOS 8 and later, you can create a XIB or storyboard file instead of a static launch image.

如果您需要一个带有导航栏和标签栏的简单启动屏幕,我的建议是使用启动文件。在ios8和以后的版本中,您可以创建一个XIB或故事板文件,而不是静态的启动映像。

You can read more about that in the next link: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/LaunchImages.html

您可以在下一个链接中阅读更多:https://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/launchimage .html

#9


0  

I Set all the above. however it didn't work when debugging again. I remove the app from the simulator and iPhone and worked straight away

以上都是我设定的。但是,当再次调试时,它没有工作。我从模拟器和iPhone上删除了这个应用程序,然后直接工作。