What size should apple-touch-icon.png be for iPad and iPhone?

前端 未结 11 2043
醉酒成梦
醉酒成梦 2021-01-29 17:11

Are Apple touch icons bigger than 60x60 supported, and if so, what dimensions should I use for the iPad and iPhone?

11条回答
  •  不思量自难忘°
    2021-01-29 17:44

    Yes, bigger than 60x60 are supported. For simplicity, create icons of these 4 sizes:

    1) 60x60  <= default
    2) 76x76
    3) 120x120
    4) 152x152
    

    Now, it's preferable to add them as links in your HTML as:

    
    
    
    
    

    You can choose to not declare the 4 links above but just declare a single link, in which case give the highest size of 152x152 or even a size higher than that, say 196x196. It will always trim down the size for re-purposing. Ensure you mention the size.

    You can also choose not to declare even a single link. Apple mentions that in this scenario, it will lookup the server root first for the size immediately higher that the size it wants (naming format: apple-touch-icon-.png), and if that's not found then it will next look for the default file: apple-touch-icon.png. It's preferable that you define the link(s) as that will minimize the browser querying your server.

    Icon necessities:

    - use PNG, avoid interlaced
    - use 24-bit PNG
    - not necessary to use web-safe colors
    

    In versions older than iOS 7, if you don't want it to add effects to your icons, then just add the suffix -precomposed.png to the file name. (iOS 7 doesn't add effects even without it).

提交回复
热议问题