简体   繁体   English

iOS导航栏图标大小iPhone 6

[英]iOS Navigation Bar Icon Size iPhone 6

Excuse me if this has been asked but I cannot seem to find a good answer. 请问是否有人问我,但是我似乎找不到一个好的答案。

I have vector PNG icons that were generated at 64x64 pixels. 我有以64x64像素生成的矢量PNG图标。

What I'm trying figure out is how to add them as custom nav bar button icons so they look good in iOS8/iPhone 6 down to iPhone4s. 我想弄清楚的是如何将它们添加为自定义导航栏按钮图标,以使它们在iOS8 / iPhone 6至iPhone4s中看起来都不错。

It seems like when I add the 64x64 icon in XCode and associate the icon with the custom button it doesn't scale down, it just remains 64x64 which is too big for the nav bar itself. 似乎当我在XCode中添加64x64图标并将该图标与不会按比例缩小的自定义按钮相关联时,它仍然保持64x64大小,这对于导航栏本身来说太大了。

What is the best way to handle this? 处理此问题的最佳方法是什么? I don't want want it to look pixelated in in retina. 我不想让它看起来在视网膜像素化。

You need add to project 2 files for each devices scales with such names: 您需要使用以下名称为每个设备缩放比例添加到项目2文件中:

  • your_icon_name@2x.png - for iPhone4, 4s, 5, 5s and iPhone6; your_icon_name@2x.png-适用于iPhone4、4s,5、5s和iPhone6;
  • your_icon_name@3x.png - for iPhone6 plus. your_icon_name@3x.png-适用于iPhone6 plus。

https://developer.apple.com/library/IOs/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html - The sizes of icons for each scale. https://developer.apple.com/library/IOs/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html-每个刻度的图标大小。

https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/LoadingResources/ImageSoundResources/ImageSoundResources.html#//apple_ref/doc/uid/10000051i-CH7-SW17 - This to learn deeper about different resolutions support in iOS. https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/LoadingResources/ImageSoundResources/ImageSoundResources.html#//apple_ref/doc/uid/10000051i-CH7-SW17-这可以更深入地了解有关不同分辨率的支持在iOS中。

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

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