cordova for ios: Unable to simultaneously satisfy constraints.

  使用cordova开发ios项目的时候,在上传图片碰到一个问题。使用html的<input type="file"/>标签来选择照片或者拍照片,引起了布局报错,然后图片上传过程中很容易崩溃闪退。

html页面代码:

<html><head></head>
<body>
        <input type="file" />
    </body>
</html>

然后在真机测试,点击选择文件,控制台出现布局报错日志:

Unable to simultaneously satisfy constraints.
    Probably at least one of the constraints in the following list is one you don‘t want.
    Try this:
        (1) look at each constraint and try to figure out which you don‘t expect;
        (2) find the code that added the unwanted constraint or constraints and fix it.
(
    "<NSLayoutConstraint:0x156734e0 UILabel:0x1568b9f0.width == UIView:0x155d9110.width - 32>",
    "<NSLayoutConstraint:0x1568db80 UIView:0x155d9110.width == UIView:0x155d8fc0.width>",
    "<NSLayoutConstraint:0x156913b0 H:[UIView:0x155d8fc0(30)]>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x156734e0 UILabel:0x1568b9f0.width == UIView:0x155d9110.width - 32>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.

然后上传图片或者视频的时候,常会出现崩溃闪退现象。在cordova和phonegap搜了下,没搜到解决的办法,不知道哪位兄台又碰到这个问题么,指点我一下!

完整cordova for ios demo下载:http://download.csdn.net/detail/tandaxia/9455872

原文链接:http://www.cnblogs.com/tandaxia/p/5255394.html

时间: 2024-08-03 23:33:42

cordova for ios: Unable to simultaneously satisfy constraints.的相关文章

iOS使用代码调整约束做动画效果时出现Unable to simultaneously satisfy constraints.

出现这个问题时, 首先应该仔细看错误, 去除多余的存在冲突的约束, Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect;

Unable to simultaneously satisfy constraints.

Unable to simultaneously satisfy constraints 表示无法同时满足所有约束. 一.出现的场景 当我创建一个width为100的视图,我添加距左约束300,居右约束300后,运行后视图不显示,而且控制台有输出. 原因:屏幕的宽度为640时,而上面100+300+300已经超出屏幕的宽度,这是width被压缩,所以导致了这个问题... 二.基本概念 1.intrinsicContentSize:固有大小.即视图在不受约束影响时,本来的尺寸. 2.Content

自动布局报错(两条连线冲突):Unable to simultaneously satisfy constraints

这个报错有些长: Unable to simultaneously satisfy constraints.    Probably at least one of the constraints in the following list is one you don't want.     Try this:         (1) look at each constraint and try to figure out which you don't expect;         (2

浅析 Cordova for iOS

转自@夏小BO的技术博客: Cordova,对这个名字大家可能比较陌生,大家肯定听过 PhoneGap 这个名字,Cordova 就是 PhoneGap 被 Adobe 收购后所改的名字.(Cordova网址以及框架下载地址:http://cordova.apache.org/) Cordova 是一个可以让 JS 与原生代码(包括 Android 的 java,iOS 的 Objective-C 等)互相通信的一个库,并且提供了一系列的插件类,比如 JS 直接操作本地数据库的插件类. 这些插件

Mac下利用Cordova打包 iOS App以及出现的问题

安装 cordova sudo npm install cordova 创建项目 创建一个demo文件夹,里面自动加载基本的文件以及目录 cordova create demo com.test.demo demo 把web工程拷贝到demo/www目录下 准备 $ npm install -g ios-sim $ npm install -g ios-deploy 安装这两个插件,参数-g是全局安装. add platform切换到demo目录下,因为之前demo项目已经有了cordova a

cordova与ios native code交互的原理

非常早曾经写了一篇博客,总结cordova插件怎么调用到原生代码:cordova调用过程,只是写得太水.基本没有提到原理.近期加深了一点理解,又一次补充说明一下 js调用native 以下是我们产品中的代码片段: datePicker.show(options, function (date) { var month = date.getMonth() + 1; callback(null, date.getFullYear() + "-" + month + "-"

Cordova - 使用Cordova开发iOS应用实战1(配置、开发第一个应用)

Cordova - 使用Cordova开发iOS应用实战1(配置.开发第一个应用) 现在比较流行使用 html5 开发移动应用,毕竟只要写一套html页面就可以适配各种移动设备,大大节省了跨平台应用的开发时间.而不像以前一样 Android 要写一套程序,iOS 要写一套,甚至 Windows Phone 还要再写一套程序. 虽然使用H5开发的界面很容易适配各种手机设备,但由于系统的差异,如果要访问原生的设备功能(如摄像头.麦克风等)还是有些不便,或者说不是那么统一.这时我们可以借助 Cordo

iOS Programming Auto Layout: Programmatic Constraints 自动布局:通过编程限制

iOS Programming? Auto Layout: Programmatic Constraints? 1.? However, if your views are created in code, then you will need to constrain them programmatically. 如果你的view是由代码创建的,那么你需要用编程限制它了. To have a view to work with, you are going to recreate the im

Cordova for iOS[ PhoneGap]

安装这个费了点劲,和早前的PhoneGap有些不同. Cordova支持如下移动操作系统:iOS, Android,ubuntu phone os, Blackberry, Windows Phone, Palm WebOS, Bada 和 Symbian. Cordova是从PhoneGap中抽出的核心代码,贡献给Apache的项目,是驱动PhoneGap的核心引擎. 下载去apache即可. 安装说明: 1.下载node.js 2.安装node.js不说了,执行即可(npm随之安装) 3.终