Ionic开发中常见问题和解决方案记录
1npm按装包失败
更换源:npm config set registry https://registry.npm.taobao.org
或者使用cnpm
sudo npm install -g cnpm --registry=https://registry.npm.taobao.org
2.ionic真机调试
ionic run android --livereload -c -s
3.ionic run ios 报错
sudo npm install -g ios-deploy --unsafe-perm=true
4.跨域(这个问题在android上有,请求发不出去)
cordova plugin add cordova-plugin-whitelist
5.google跨域插件:
Access-Control-Allow-Origin
6.更改statusbar颜色
cordova plugin add cordova-plugin-statusbar
7.ionic生成图标资源
准备好icon.png 和splash.png
ionic resources
8.解决android tabs的布局调到底部,和iOS一致
$ionicConfigProvider.tabs.position('bottom');
9.android录制屏幕:
adb shell screenrecord /sdcard/video/littleQ.mp4 命令录制
问题:
Using this version of Cordova with older version of cordova-android is being deprecated. Consider upgrading to cordova-android@5.0.0 ro newer
删除platforms对应的平台,重新platform add [platform]
ionic build android : Unable to start the daemon process error
在用户文件夹中找到.gradle文件夹,新增gradle.properties文件,内容如下:
org.gradle.jvmargs=-Xmx512m
ionic跨域问题,在接口端加上:
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
$timeout(function () {
//return false; // <--- comment this to "fix" the problem
var sv = $ionicScrollDelegate.$getByHandle('horizontalScroll').getScrollView();
var container = sv.__container;
var originaltouchStart = sv.touchStart;
var originalmouseDown = sv.mouseDown;
var originaltouchMove = sv.touchMove;
var originalmouseMove = sv.mouseMove;
container.removeEventListener('touchstart', sv.touchStart);
container.removeEventListener('mousedown', sv.mouseDown);
document.removeEventListener('touchmove', sv.touchMove);
document.removeEventListener('mousemove', sv.mousemove);
sv.touchStart = function (e) {
e.preventDefault = function () { }
if (originalmouseMove) {
originaltouchStart.apply(sv, [e]);
}
}
sv.touchMove = function (e) {
e.preventDefault = function () { }
if (originalmouseMove) {
originaltouchMove.apply(sv, [e]);
}
}
sv.mouseDown = function (e) {
e.preventDefault = function () { }
if (originalmouseMove) {
originalmouseDown.apply(sv, [e]);
}
}
sv.mouseMove = function (e) {
e.preventDefault = function () { }
if (originalmouseMove) {
originalmouseMove.apply(sv, [e]);
}
}
container.addEventListener("touchstart", sv.touchStart, false);
container.addEventListener("mousedown", sv.mouseDown, false);
document.addEventListener("touchmove", sv.touchMove, false);
document.addEventListener("mousemove", sv.mouseMove, false);
});
Ionic开发中常见问题和解决方案记录的更多相关文章
- ionic开发中,输入法键盘弹出遮挡住div元素
采用ionic 开发中,遇到键盘弹出遮挡元素的问题. 以登陆页面为例,输入用户名和密码时,键盘遮挡了登陆按钮. 最终采用自定义指令解决了问题: .directive('popupKeyBoardSho ...
- react + antiDesign开发中遇到的问题记录
react + antiDesign开发中遇到的问题记录 一:页面中子路由失效: antiDesign的官方实例中,会把路由重复的地方给去重,而且路由匹配模式不是严格模式.所以我们需要在util.js ...
- iOS开发中常见问题集锦
在iOS开发中,会出现各种各样的问题.今天,就把这些常见的问题以及各位大牛的解决方案汇总下,方便以后查阅: 常见错误: 1. linker command failed with exit code ...
- Android Studio使用过程中常见问题及解决方案
熟悉Android的童鞋应该对Android Studio都不陌生.Android编程有两个常用的开发环境,分别是Android Studio和Eclipse,之前使用比较多的是Eclipse,而现在 ...
- 关于ionic开发中遇到的坑与总结
这次是第二次使用ionic开发混合app,今天算是对这个框架做一个总结,基础的我就不再重复了,网上都有教程.我就说说自己的心得和遇见的各种坑, 之后会陆续补充,想到什么说什么吧. 1.关于ionic效 ...
- 开发中的一些解决方案(c#)
1.如果需要配置文件,不妨考虑用XML序列化技术实现XML配置文件.在C#中引入System.Xml.Serialization命名空间,编写实体类序列化到XML文件中(或反序列化到对象),编写少量代 ...
- SAP HANA开发中常见问题- 基于SAP HANA平台的多团队产品研发
大家都知道SAP HANA项目打包成Delivery Unit(缩写为DU).依照"官方"的开发模式,特别是整个团队仅仅使用一个HANA Instance进行项目开发,因为HANA ...
- 个人理解---在开发中何时加入日志记录功能[java]
是这样的:俩个月前做的一个小功能,今天经理突然问我这个'清除复投记录'功能是不是我做的,我说是,很久以前了.他说昨天一个客户找过来了,后台把人家的复投记录清除掉了,不知道何时清除的,我记得当时做的时候 ...
- Android开发中常见问题分析及解决
最近公司有新的业务需求,需要开发一款APP,因为我开发过Android APP(我想告诉他们,那是4年前的事了,嘤嘤嘤),就把开发任务交给我了,当然也不是我一个人啦,让我组开发小组,说白了,就是让我来 ...
随机推荐
- springMvc基本注解:@Component、@Repository(持久层) 、@Service(业务逻辑) 、@Controller(控制层)
1.@Controller(控制层) :就是action层 2.@Service(业务逻辑) :业务逻辑层,负责处理各种控制层的操作 3.@Repository(持久层) :称为“持久化”层,负责对数 ...
- android编程常见问题-No Launcher activity found!
新手编程常见的问题: 问题表现: console提示:No Launcher activity found! The launch will only sync the application pac ...
- [转载]C#获取本机IPv4地址
C#获取本机IP地址在C#1.0之后都使用下面的这种形式: IPHostEntry ipe = Dns.GetHostEntry(Dns.GetHostName()); IPAddress ipa=i ...
- 高性能网络编程2----TCP消息的发送
转 陶辉 taohui.org.cn 在上一篇中,我们已经建立好的TCP连接,对应着操作系统分配的1个套接字.操作TCP协议发送数据时,面对的是数据流.通常调用诸如send或者write方法来发送数据 ...
- Ajax出入江湖
window.onload = initAll; var xhr = false; function initAll() { if (window.XMLHttpRequest) { xhr = ne ...
- 关于StringBuilder
写在前面的话 很久没有更新博客了,来上海实习身边的一切波动挺大的,还好我走过来了,博客园:一路有你! StringBuilder 相信大家对StringBuilder类型一定不陌生,我们Coding经 ...
- Unity3D 问题流水总结
一.error CS1612:Cannot modify a value type return value of `UnityEngine.SliderJoint2D.limits'. Consid ...
- 【redis】06Redis的高级应用之事务处理、持久化操作、pub_sub、虚拟内存
上节课详细讲解了redis数据库的常用命令,以及redis数据库高级应用当中的, 安全性,跟咱们的主从复制, 这节课呢,咱们继续来讲咱们的高级应用, 首先来看一下咱们的事务处理, 事务处理 我前面说过 ...
- 在IDEA上用python来连接集群上的hive
1.在使用Python连接hive之前需要将hive中的文件拷贝到自己创建python项目中 cp -r apache-hive--bin/lib/py /home/jia/Desktop 2.把h ...
- ZOJ 3757 Alice and Bob and Cue Sports(模拟)
题目链接 题意 : 玩台球.Alice 和 Bob,一共可以进行m次,Alice 先打.有一个白球和n个标有不同标号的球,称目标球为当前在桌子上的除了白球以外的数值最小的球,默认白球的标号为0.如果白 ...