ios - UIImagePickerController Causes Autolayout Errors with Video Only -
i using uiimagepickercontroller can bring camera, photo album, or video controls. there no issues camera or photo album; however, when apple video controls brought ton of autolayout errors show in debugger. apple's stock view , not can control. here errors shows:
unable simultaneously satisfy constraints.
probably @ least 1 of constraints in following list 1 don't want. try this: (1) @ each constraint , try figure out don't expect; (2) find code added unwanted constraint or constraints , fix it. (note: if you're seeing nsautoresizingmasklayoutconstraints don't understand, refer documentation uiview property translatesautoresizingmaskintoconstraints)
(
"<nslayoutconstraint:0x198b4b60 v:|-(11)-[camflipbutton:0x156d6300] (names: '|':cambottombar:0x1988e810 )>", "<nslayoutconstraint:0x1989c060 camshutterbutton:0x198a30b0.centery == cambottombar:0x1988e810.centery>", "<nslayoutconstraint:0x19869eb0 'uiview-encapsulated-layout-height' v:[plimagepickercameraview:0x162e8600(0)]>", "<nslayoutconstraint:0x157e44e0 cambottombar:0x1988e810.height == plimagepickercameraview:0x162e8600.height>", "<nslayoutconstraint:0x157f80e0 v:[camflipbutton:0x156d6300]-(0)-[uiview:0x1986a9a0]>", "<nslayoutconstraint:0x15732e50 uiview:0x1986a9a0.bottom == camshutterbutton:0x198a30b0.top>"
)
will attempt recover breaking constraint
make symbolic breakpoint @ uiviewalertforunsatisfiableconstraints catch in debugger.
the methods in uiconstraintbasedlayoutdebugging category on uiview listed in may helpful.
again standard controller instantiated such:
self.mediapicker = [[uiimagepickercontroller alloc]init]; if ([mediatype isequaltostring:@"camera"] || [mediatype isequaltostring:@"video"]) self.mediapicker.sourcetype = uiimagepickercontrollersourcetypecamera; else self.mediapicker.sourcetype = uiimagepickercontrollersourcetypephotolibrary; if ([mediatype isequaltostring:@"video"]) { self.mediapicker.mediatypes = [[nsarray alloc]initwithobjects:(nsstring *)kuttypemovie, nil]; [self.mediapicker setvideomaximumduration:30.0f]; } else self.mediapicker.allowsediting = yes; self.mediapicker.delegate = self; [self presentviewcontroller:self.mediapicker animated:yes completion:nil];
Comments
Post a Comment