OS X icons size

前端 未结 6 717
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-30 09:40

What size should an application icon and menu bar icon for OS X be?

I can deal with small resolution displays but what about Retina - does an icon displayed on the men

6条回答
  •  南笙
    南笙 (楼主)
    2021-01-30 10:01

    To make your menu item support Retina displays, Dark Mode and different states (e.g. pressed)

    1. Create two PNG images sized 16x16 and 32x32 pixels
    2. Create a new image asset in Xcode with Render As set to Template Image and add your images for 1x and 2x
    3. Initialize your NSImage from the image asset without changing its size: NSImage(named: "Example")

提交回复
热议问题