iOS导航栏项目图像大小 [英] iOS navigation bar item image size
问题描述
我想自定义我的NavigationBar
按钮并使用自己的图像.
I want to customize my NavigationBar
button and using my own images.
问题是尺寸应该是多少?
The question is what the size should be?
我发现按钮的尺寸应该是40 * 40,所以视网膜的图像应该是80 * 80?
I found that the button size should be 40*40, so the image should be 80*80 for retina?
推荐答案
These are the sizes that the documentation recommends for custom icons now.
- @ 2:50 x 50
- @ 3:75 x 75
创建两个以上像素大小的图像,然后将它们添加到Assets.xcassets文件中的新图像集中. (显然,不再需要@ 1大小了.)
Create two images of the above pixel sizes and then add them to a new image set in your Assets.xcassets file. (Apparently the @1 size is no longer needed.)
或者,您可以使用通用矢量图像(pdf)(请参阅).这是我最近的偏好.
Alternatively, you could use a universal vector image (pdf) (see here and here). This has been my preference recently.
相关答案
这篇关于iOS导航栏项目图像大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!