简体   繁体   English

如何从属性检查器中为图像视图选择带有后缀的图像?

[英]How do i choose an image with a suffix from within attributes inspector for an image view?

I just started learning iOS developing, and i'm reading along with a tutorial for an universal app. 我刚刚开始学习iOS开发,并且正在阅读通用应用程序的教程。 The first step is to set an background image to both the Main_iPhone.storyboard and Main_iPad.storyboard . 第一步是为Main_iPhone.storyboardMain_iPad.storyboard设置背景图像。

I dragged and dropped an image view on the iPhone storyboard, used the attributes inspector to set the image to: background-menu.png , which i was able to choose from in the drop down for images. 我将图像视图拖放到iPhone故事板上,使用属性检查器将图像设置为: background-menu.png ,我可以从下拉菜单中进行选择。

Turing to the iPad storybord now, trying to do the same procedure as for the iPhone storyboard except i was told in the tutorial to choose the background image of: background-menu~ipad.png , which i don't seem to have access to from the: attributes inspector -> image -> drop-down-list. 现在转向iPad Storybord,尝试执行与iPhone Storyboard相同的过程,除了本教程中告诉我选择以下背景图像: background-menu~ipad.png ,我似乎无法访问它。从:属性检查器->图像->下拉列表中。

In the "main" folder images i have 9 different images, but the ones showing in the attributes inspector for the image views are the three images not having any suffix like: ~ipad , @2x , @2x~ipad . 在“主”文件夹images我有9个不同的图像,但在属性检查器中显示的图像视图是三个没有后缀的图像,例如: ~ipad@2x@2x~ipad

Is there a way to get these images showing so that i can use them, or am i doing something wrong? 有没有办法让这些图像显示出来,以便我可以使用它们,或者我做错了什么?

~ symbol in the image name is used to specify "Device Specific Images". 图像名称中的〜符号用于指定“设备特定图像”。 You select "background-menu.png" for iPad also from attributes inspector. 您也可以从属性检查器中为iPad选择“ background-menu.png”。 iOS runtime will automatically pick "background-menu~iPad.png" if you use an iPad simulator/device to run your example. 如果您使用iPad模拟器/设备运行示例,iOS运行时将自动选择“ background-menu〜iPad.png”。

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

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