ThemeableBrowser在IOS中按钮图片的使用
1. 首先确保图片的名称为 ***@1x.png, ***@2x.png 或 ***@3x.png
| iPhone —— iPhone3GS | ***@1x.png |
| iPhone —— iPhone6 | ***@2x.png |
| iPhone 6 Plus and above | ***@3x.png |
2. 复制图片到以下目录
<cordova_project_root>/platforms/ios/<project_name>/Resources
Resources文件夹不存在的话,请自行创建。
3. 复制图片到XCode的Resources文件夹下

大功告成!!!下来就可以在项目中正常使用了

To import image resources for iOS, it is slightly trickier, because you have to register your file in Xcode project file with help from Xcode, and there are two ways of doing this. Let's start with the old school way. iOS also shares similar concept with Android in terms of pixel density. iPhone to iPhone 3GS uses 1x the resolution, iPhone 4 to iPhone 6 uses 2x the resolution while iPhone 6 Plus and above uses 3x the resolution (even though it's actually down scaled, but that's a different discussion). In the old school way, you have to name your images with @1x, @2x, and @3x suffix with respect to their target density. eg. icon@2x.png. Here is a documentation that explains this concept. You then have to move it under
<cordova_project_root>/platforms/ios/<project_name>/Resources
Then open your native iOS project with Xcode by double clicking on
<cordova_project_root>/platforms/ios/<project_name>.xcodeproj
In the left hand side panel, make sure you are in Project navigator tab. Then you can see a list of directories under your project. One of them being Resources, but you don't see your newly added images there. Now you need to drag your images fron Finder to Xcode and drop it under Resource folder. In your JavaScript config, you can then reference to them without suffix or extension. eg. With the previous example, simply icon will suffice.
ThemeableBrowser在IOS中按钮图片的使用的更多相关文章
- 解决iOS中tabBarItem图片默认颜色的问题(指定代码渲染模式为以原样模式的方式显示出来)
解决iOS中tabBarItem图片默认颜色的问题(指定代码渲染模式为以原样模式的方式显示出来) 解决办法:指定图片的渲染模式(imageWithRenderingMode为:UIImageRende ...
- iOS中按钮点击事件处理方式
写在前面 在iOS开发中,时常会用到按钮,通过按钮的点击来完成界面的跳转等功能.按钮事件的实现方式有多种,其中 较为常用的是目标-动作对模式.但这种方式使得view与controller之间的耦合程度 ...
- JS 解决 IOS 中拍照图片预览旋转 90度 BUG
上篇博文[ Js利用Canvas实现图片压缩 ]中做了图片压缩上传,但是在IOS真机测试的时候,发现图片预览的时候自动逆时针旋转了90度.对于这个bug,我完全不知道问题出在哪里,接下来就是面向百度编 ...
- iOS中拉伸图片的几种方式
假如下面的一张图片,是用来做按钮的背景图片的,原始尺寸是(128 * 112) 按钮背景图片.png 我们通过代码将这张图片设置为按钮的背景图片,假如我们将创建好的按钮的宽高设置为:(W=200, H ...
- IOS中修改图片的大小:修改分辨率和裁剪
在IOS开发中,经常有限制图片文件大小的,有的用户图片很大,导致上传时间慢,造成问题. 如:微信分享中,如果图片的大小好像大于50kbytes,就分享失败,而且没有任何提示. 所以,我添加了两个函数: ...
- iOS中 按钮和标题完美各种排列/完美教程 韩俊强的博客
每日更新关注:http://weibo.com/hanjunqiang 新浪微博! 前言:最近常常用到按钮和相应标题的组合,当按钮设置图片加标题时,触发范围较小,不易触发,最重要的是还要调试偏移量, ...
- 微信中使用popup等弹窗组件时点击输入框input键盘弹起导致IOS中按钮无效处理办法
因为在IOS微信中在弹窗中使用input使键盘弹起,使弹窗的位置上移,当键盘关闭时页面还在上面,弹窗位移量也在上面,只有下拉才能回到原位,这样弹窗也消失了.我的处理办法就是在键盘弹起和消失的时候,让页 ...
- IOS中实现图片点击全屏预览
//// ViewController.m// XWZoomImageView//// Created by xiao on 15/11/13.// Copyright © 2015年 xiao. A ...
- 设置ios中imageView图片自适应,
UIIimageView *imageView = [UIImageView alloc]init]; [imageView setContentScaleFactor:[[UIScreen mai ...
随机推荐
- AviSynth AVS Importer Plugin for Adobe Premiere Pro CC 2015 x64
Premiere CS AVS Importer x64.prm copy to Adobe\Adobe Premiere Pro CC 2015\Plug-Ins\Common\ VSFilterM ...
- 008_falcon磁盘io计算方法
一.falcon磁盘IO告警计算方法 (1)线上告警示例 [falcon]环境: prod 时间: 2018-11-10 22:29 共1条 [#主机磁盘io过高(appid)]主机hostname磁 ...
- Git系列②之部署企业级开源仓库gitlab服务器
Git系列②之部署企业级开源仓库gitlab服务器 上一篇我们介绍了github的常见使用方法,下面开始部署本地开源仓库gitlab GitLab 是一个用于仓库管理系统的开源项目. 1.安装配置gi ...
- Ex3_7无向图二部图_十一次作业
(a) 从图中的某个顶点做深度优先遍历,并将不同层的顶点标记为红黑两种颜色,使得每条树边的两个顶点的颜色都不相同,如果遇到一条回边并且两个顶点的颜色都相同则说明图不是二部图. (b)如果存在一个长度为 ...
- 用layui搭建的后台框架
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 协程,twisted
最原始的请求url_list=[ 'https://www.cnblogs.com/yunxintryyoubest/category/1338759.html', 'https://www.cnbl ...
- Java_解惑
书名 ================================================================================================= ...
- 尚硅谷《全套Java、Android、HTML5前端视频》
尚硅谷<全套Java.Android.HTML5前端视频> (百万谷粉推荐:史上最牛.最适合自学的全套视频.资料及源码) [尚硅谷官网资料导航] 谷粒学院在线学习:http://www.g ...
- 本文转自 MyEclipse 2015反编译插件安装
本文转自MyEclipse 2015反编译插件安装 分享一下下载插件的地址,百度网盘:链接:http://pan.baidu.com/s/1nturiAH 密码:yk73 其次:我来说下具体操作步骤: ...
- mouseover、mouseout与mouseenter、mouseleave
待定 附加链接: http://www.aijquery.cn/Html/jqueryrumen/129.html