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

posted @ 2016-03-08 20:08  谈晓鸣  阅读(989)  评论(0编辑  收藏  举报