The Contents.json describing the image set "BG_Email_Textfield.imageset" must start with a top level

If you use Xcode to add a single image to your project as an image set, Xcode creates a subdirectory containing two files- the image and a Contents.json file. You can see this in Finder. In your Xcode project directory open Images.xcassets. For example Images.xcassets could have a subdirectory myImage.imageset with myImage.png and a Contents.json similar to

{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x",
      "filename" : "myImage.png"
    },
    {
      "idiom" : "universal",
      "scale" : "2x"
    }
  ],
  "info" : {
    "version" : 1,
    "author" : "xcode"
  }
}

You can specify another image for 2x resolution. If your project does not contain a directory and Contents.json file similar to this, it may be easiest to use Xcode to add the image set. In Xcode project navigator, if you select Images.xcassets a pane appears with a small "+" at the bottom to "add a group or image set".

References
https://developer.apple.com/library/ios/recipes/xcode_help-image_catalog-1.0/AddingImageSets/AddingImageSets.html
https://www.iphonelife.com/blog/31369/unleash-your-inner-app-developer-managing-images-xcode-5-asset-catalogs

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值