【发布时间】:2014-12-31 02:35:53
【问题描述】:
代码:
-(BOOL) startMediaBrowser:(GSAvatarSettingView *)sender{
if (([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera] == NO)) {
return NO;
}
UIImagePickerController *cameraUI = [[UIImagePickerController alloc] init];
cameraUI.sourceType = UIImagePickerControllerSourceTypeCamera;
cameraUI.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera];
cameraUI.allowsEditing = YES;
cameraUI.delegate = self;
[cameraUI.view setTranslatesAutoresizingMaskIntoConstraints:NO];
[self presentViewController:cameraUI animated:NO completion:^{}];
return YES;
}
错误: 对尚未渲染的视图进行快照会导致快照为空。确保在快照或屏幕更新后的快照之前至少渲染一次视图。 2014-12-31 09:25:26.437 [5260:1316105] 无法同时满足约束条件。 以下列表中的至少一个约束可能是您不想要的。试试这个:(1)查看每个约束并尝试找出您不期望的; (2) 找到添加了一个或多个不需要的约束的代码并修复它。 (注意:如果您看到不理解的 NSAutoresizingMaskLayoutConstraints,请参阅 UIView 属性 translatesAutoresizingMaskIntoConstraints 的文档) ( "", "", "", "", "", "", “” )
将尝试通过打破约束来恢复
在 UIViewAlertForUnsatisfiableConstraints 创建一个符号断点,以便在调试器中捕获它。 中列出的 UIView 上的 UIConstraintBasedLayoutDebugging 类别中的方法也可能会有所帮助。 2014-12-31 09:25:26.439 GSStudent [5260:1316105] 无法同时满足约束条件。 以下列表中的至少一个约束可能是您不想要的。试试这个:(1)查看每个约束并尝试找出您不期望的; (2) 找到添加了一个或多个不需要的约束的代码并修复它。 (注意:如果您看到不理解的 NSAutoresizingMaskLayoutConstraints,请参阅 UIView 属性 translatesAutoresizingMaskIntoConstraints 的文档) ( "", "", "", "", "", “” )
将尝试通过打破约束来恢复
在 UIViewAlertForUnsatisfiableConstraints 创建一个符号断点,以便在调试器中捕获它。 中列出的 UIView 上的 UIConstraintBasedLayoutDebugging 类别中的方法也可能会有所帮助。
【问题讨论】:
标签: ios ipad camera uiimagepickercontroller