简体   繁体   English

Xcode 7.2资产目录更改

[英]Xcode 7.2 Asset Catalog Changes

I'd like to ask for help regarding the new changes in Xcode 7.2 assets catalog. 我想就Xcode 7.2资产目录中的新变化寻求帮助。 I'd like to have an image set for my navigation bar. 我想为我的导航栏设置一个图像。 There's now a width and height options panel for a set of images in Xcode 7.2 in the Attributes inspector. 现在,属性检查器中的Xcode 7.2中的一组图像的宽度和高度选项面板。 I've set my width to Any & Compact which I guess is for a portrait orientation only. 我已经将我的宽度设置为Any&Compact,我猜这只是为了纵向方向。 Will I set my height also to Any & Regular for a portrait orientation? 我是否也将我的身高设置为Any&Regular以进行纵向定位? Am I doing it wrong? 我做错了吗? Is there other settings to consider for using an image as a navigation bar? 是否有其他设置要考虑将图像用作导航栏?

For reference, my @2x is set to 640x192px for iPhone 5s while my @3x is set to 1242x192px for iPhone 6s Plus. 作为参考,对于iPhone 5s,我的@ 2x设置为640x192px,而对于iPhone 6s Plus,我的@ 3x设置为1242x192px。 I know that for iPhone 6s, my image should be 750x192px but where will I set that in the assets catalog? 我知道对于iPhone 6s,我的图像应该是750x192px,但我会在资产目录中设置它?

资产目录中我的标题图像的当前状态

属性检查员

Well. 好。 Compact width and Any height is considered portrait for iPhones. 紧凑的宽度和任何高度被认为是iPhone的肖像。 You describe Any width and compact height in your post which is landscape mode. 您可以在帖子中描述任意宽度和紧凑高度,即横向模式。 I do not have Xcode 7.2 yet but go ahead and change the value of your image to have compact width and Any height. 我还没有Xcode 7.2但是请继续将图像的值更改为具有紧凑的宽度和任何高度。

however, you should only do that if you are planning to have portrait and landscape have different images. 但是,如果您计划让肖像和风景有不同的图像,那么您应该这样做。 If you are gonna use the same image in both situations then I suggest leaving it at any width and any height. 如果你要在两种情况下使用相同的图像,那么我建议将它留在任何宽度和任何高度。

The above is merely speculation. 以上仅仅是猜测。 I am making assumptions based on my knowledge of how size classes work in storyboards. 我根据我对大小类在故事板中的工作原理的了解做出了假设。 I THINK the same logic and reasoning should apply in the new asset catalog. 我认为相同的逻辑和推理应该适用于新的资产目录。

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

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