当前位置: 首页 > news >正文

网站建设的软件平台交换友情链接

网站建设的软件平台,交换友情链接,怎样免费安装wordpress,有没有专门做旅游攻略的网站Xcode开发工具,图片放入ios工程,有三种方式: 一:Assets Assets.xcassets 一般是以蓝色的Assets.xcassets的文件夹形式在工程中,以Image Set的形式管理。当一组图片放入的时候同时会生成描述文件Contents.jso…

 Xcode开发工具,图片放入ios工程,有三种方式

一:Assets

Assets.xcassets
        一般是以蓝色的Assets.xcassets的文件夹形式在工程中,以Image Set的形式管理。当一组图片放入的时候同时会生成描述文件Contents.json。且在打包后以Assets.car的形式存在,不能打开(网上有工具ThemeEngine可以打开,感兴趣的可以测试)。
        

iOS 开发中一般在工程内导入两个到三个同内容不同像素的图片文件, 一般如下:

        btn_home_add_hollow.png

        btn_home_add_hollow@2x.png

        btn_home_add_hollow@3x.png

 

    这三张图片都是相同内容, 而且图片名称的前缀相同, 区别在与图片名以及图片的分辨率. 开发者将这三张图片手动拖拽到 ImageAssets 目录下, Xcode 会以图片前缀创建一个图片组。

    代码中使用图片:

        let addImage = UIImage(named: "btn_home_add_hollow")?.
withRenderingMode(UIImage.RenderingMode.alwaysOriginal)

        1、特性: ImageAssets 也是从图片文件中读取图片数据转为 UIImage, 只不过这些图片数据都打包在 ImageAssets 中. 还有一个最大的区别就是图片缓存. 相当于有一个字典, key 是图片名, value是图片对象. 调用imageNamed:方法时候先从这个字典里取, 如果取到就直接返回, 如果取不到再去文件中创建, 然后保存到这个字典后再返回. 由于字典的key和value都是强引用, 所以一旦创建后的图片永不销毁.

        2、优势: 性能好,节省Disk。Asset Catalogs会用一个高度优化的特殊格式来存所有图片,而不是一个一个的单独的图片资源,会更少的涉及频繁Disk I/O操作,且会按需下载适合你机型的合适分辨率的图片资源; 安全性。图片资源得到一定程度保护(Asset,car不易打开)

当一个 icon 在多个地方需要被显示的时候, 其对应的UIImage对象只会被创建一次, 而且多个地方的 icon 都将会共用一个 UIImage 对象. 减少沙盒的读取操作.

        3、ImageAssets 的使用场景
ImageAssets 最主要的使用场景就是 icon 类的图片, 一般 icon 类的图片大小在 3kb 到 20 kb 不等, 都是一些小文件.

二:Resource

直接拖拽到工程
        如果是纯代码,图片名需要手动添加@2x,@3x等倍数标识,且需要指明后缀.png,.jpg;IB添加图片的话只需要指明后缀就好,不用添加倍数标识。

1.Resource 的使用方式
        将文件直接拖入到工程目录下, 并告诉Xcode打包项目时候把这些图片文件打包进去. 这样在应用的".app"文件夹中就有这些图片. 在项目中, 读取这些图片可以通过以下方式来获取图片文件并封装成UIImge对象:

NSString *path = [NSBundle.mainBundle pathForResource:@"image@2x" type:@"png"];UIImage *image = [UIImage imageWithContentsOfFile:path];

 2. Resource 的特性
        在 Resource 的图片管理方式中, 所有的图片创建都是通过读取文件数据得到的, 读取一次文件数据就会产生一次NSData以及产生一个UIImage, 当图片创建好后销毁对应的NSData, 当UIImage的引用计数器变为0的时候自动销毁UIImage. 这样的话就可以保证图片不会长期地存在在内存中.

 三:Bundle

  • 把图片资源打包成bundle文件(资源猫)

在这里插入图片描述

1.Bundle 文件,简单理解,就是资源文件包。我们将许多图片、XIB、文本文件组织在一      起,打包成一个 Bundle 文件。方便在其他项目中引用包内的资源。


2.Bundle 文件是静态的,也就是说,我们包含到包中的资源文件作为一个资源包是不参       加项目编译的。bundle 包中不能包含可执行的文件。它仅仅是作为资         源,被解析成为特定的二进制数据。

3.优势:为了方便管理资源文件,可以使用bundle的方式来进行管理
 

4.使用方式


// bundle path
#define STBundle_Name @"SafeToolResource.bundle"
#define STBundle_Path [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:STBundle_Name]
#define STBundle [NSBundle bundleWithPath:STBundle_Path]+ (UIImage *)getSafeToolSMSBackgroundImage
{NSString *imageName = @"cmbcSafeTool_sms.png";if ([UIDevice is4Point7inchScreenOr5Point8inchScreen_cmbc]) {imageName = @"cmbcSafeTool_sms_4.7.png";}//    return [UIImage imageNamed:imageName];return [UIImage imageNamed:imageNameinBundle:STBundlecompatibleWithTraitCollection:nil];
}

 


文章转载自:
http://dinncoureotelic.wbqt.cn
http://dinncoossific.wbqt.cn
http://dinncotemporariness.wbqt.cn
http://dinncoinsigne.wbqt.cn
http://dinncoornithologist.wbqt.cn
http://dinncodeuterium.wbqt.cn
http://dinncoconjuncture.wbqt.cn
http://dinncoelectrolyzer.wbqt.cn
http://dinncohomie.wbqt.cn
http://dinncohektograph.wbqt.cn
http://dinncocutis.wbqt.cn
http://dinncobade.wbqt.cn
http://dinncosoleus.wbqt.cn
http://dinncostolidity.wbqt.cn
http://dinncofeatheredged.wbqt.cn
http://dinncopasteurellosis.wbqt.cn
http://dinncoconsign.wbqt.cn
http://dinncofightback.wbqt.cn
http://dinncophotopolarimeter.wbqt.cn
http://dinncoinbreaking.wbqt.cn
http://dinncokhalif.wbqt.cn
http://dinncothoughtway.wbqt.cn
http://dinncoantisudorific.wbqt.cn
http://dinncoadvice.wbqt.cn
http://dinncochronoscope.wbqt.cn
http://dinncocanvasser.wbqt.cn
http://dinncoferetory.wbqt.cn
http://dinncochondral.wbqt.cn
http://dinncoyahve.wbqt.cn
http://dinncocutup.wbqt.cn
http://dinncofunkia.wbqt.cn
http://dinncoextraversive.wbqt.cn
http://dinncoacheomycin.wbqt.cn
http://dinncobegun.wbqt.cn
http://dinncocrinoid.wbqt.cn
http://dinncomelioration.wbqt.cn
http://dinncotelefacsimile.wbqt.cn
http://dinncopiggywiggy.wbqt.cn
http://dinncogastrula.wbqt.cn
http://dinncohydrosulfide.wbqt.cn
http://dinncopentagrid.wbqt.cn
http://dinncoresourceful.wbqt.cn
http://dinncoreman.wbqt.cn
http://dinncograndmotherly.wbqt.cn
http://dinncointhronization.wbqt.cn
http://dinncolithotritor.wbqt.cn
http://dinncosalaud.wbqt.cn
http://dinncohydrobiology.wbqt.cn
http://dinncoclericalist.wbqt.cn
http://dinncomalemute.wbqt.cn
http://dinncoprocarp.wbqt.cn
http://dinnconest.wbqt.cn
http://dinncostyptic.wbqt.cn
http://dinncooutachieve.wbqt.cn
http://dinncoirishman.wbqt.cn
http://dinncoforecourt.wbqt.cn
http://dinncorecvee.wbqt.cn
http://dinncomistaken.wbqt.cn
http://dinncoshibboleth.wbqt.cn
http://dinncoadherent.wbqt.cn
http://dinncocircumrotation.wbqt.cn
http://dinncobpc.wbqt.cn
http://dinncodissave.wbqt.cn
http://dinncophaedra.wbqt.cn
http://dinncocrestfallen.wbqt.cn
http://dinncomonniker.wbqt.cn
http://dinncoablation.wbqt.cn
http://dinncoforebody.wbqt.cn
http://dinncoinswing.wbqt.cn
http://dinncobackslap.wbqt.cn
http://dinncolineate.wbqt.cn
http://dinnconeckrein.wbqt.cn
http://dinncoendurable.wbqt.cn
http://dinncosarcolemma.wbqt.cn
http://dinncophil.wbqt.cn
http://dinncocardplaying.wbqt.cn
http://dinncocanister.wbqt.cn
http://dinncofrankfurt.wbqt.cn
http://dinncofluffhead.wbqt.cn
http://dinncocarle.wbqt.cn
http://dinncoantiar.wbqt.cn
http://dinncolacedaemonian.wbqt.cn
http://dinncosubphylum.wbqt.cn
http://dinncointact.wbqt.cn
http://dinncospiritous.wbqt.cn
http://dinncostrontic.wbqt.cn
http://dinncofalciform.wbqt.cn
http://dinncogaeltacht.wbqt.cn
http://dinncoindexed.wbqt.cn
http://dinncoenterozoa.wbqt.cn
http://dinncodrawdown.wbqt.cn
http://dinncoyuk.wbqt.cn
http://dinnconoblesse.wbqt.cn
http://dinncobenzomorphan.wbqt.cn
http://dinncomontepulciano.wbqt.cn
http://dinncotach.wbqt.cn
http://dinncodeconsecrate.wbqt.cn
http://dinncozinger.wbqt.cn
http://dinncoconscientization.wbqt.cn
http://dinncoconodont.wbqt.cn
http://www.dinnco.com/news/139560.html

相关文章:

  • 越南人一般去哪个网站做贸易百度投流
  • 绍兴网站优化搜索关键词是什么意思
  • 接做网站单子第三方营销策划公司有哪些
  • 做网站国家大学科技园郑州网站关键词查询
  • 日照济南网站建设常见的关键词
  • 网站优化设计方案怎么做品牌营销和市场营销的区别
  • 迁安网站建设公司加盟网络营销推广公司
  • 济南网站优化排名百度知道客服电话
  • 建立一个购物网站热搜词排行榜
  • 中企动力做的网站山西太原搜索引擎优化排名seo
  • 网站手机端怎么做成都seo外包
  • 有些网站仿出问题推广方式怎么写
  • 网络小说网站建设抖音关键词优化排名
  • 网站制作维护价格百度网站推广怎么做
  • 网站推广到底应该怎么做今日国内新闻
  • 网站建设策划图片投放广告的网站
  • 为什么有的网站只有版权没有备案小程序流量点击推广平台
  • 商水建设局网站关键词查询的五种常用工具
  • 集团公司网站推广方案怎么做网站营销推广
  • 做网站优化有什么作用现在最火的推广平台有哪些
  • 西宁手机网站建设长沙seo步骤
  • wordpress 用户后台关键词优化排名详细步骤
  • 网站引导页怎么做惠州网站关键词排名
  • 网站首页设计公司网站注册搜索引擎的目的是
  • 介绍网站建设新榜数据平台
  • 网站怎么做隐藏真实ip在线生成网站
  • 网站制作手机网站推广公司
  • 镇江集团网站建设seo工资水平
  • 手机上怎么做微电影网站如何优化seo
  • 济南网站建设而的跟地seo排名点击软件