【发布时间】:2015-04-27 16:11:00
【问题描述】:
我正在使用 UIImagePickerController 录制视频并拍照,编辑视频并将其保存到文件中。关闭 UIImagePickerController 时,状态栏会闪烁红色并消失,有时我的标签栏会向下移动。 无法理解为什么会发生这种情况。问题出在哪里。
我想避免这种情况。我注意到这一点从 iOS8.1、iOS8、iOS7.1 等开始逐渐减少
标签栏向下移动一段时间(意味着随机)。
当我在服务器中录制视频和上传或使用 uiimagepickerviewcontreller 中的取消按钮时,为什么会出现钢筋。 .为什么我拍照的时候它不进来,为什么它不是每次都来。
-(void)mediaAction{
/// calling action sheet action
}
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
//setting for image
cameraUI = [[UIImagePickerController alloc] init];
cameraUI.delegate = self;
//Get the name of the current pressed button
NSString *buttonTitle = [actionSheet buttonTitleAtIndex:buttonIndex];
if ([buttonTitle isEqualToString:@"Record a Video"]) {
mediachecker=@"video";
cameraUI.sourceType = UIImagePickerControllerSourceTypeCamera;
cameraUI.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];
cameraUI.allowsEditing = NO;
[self presentViewController:cameraUI animated:YES completion:nil];
}
if ([buttonTitle isEqualToString:@"Upload from Gallery"]) {
//NSLog(@"ChooseFromGallery");
mediachecker=@"video";
cameraUI.allowsEditing = YES;
cameraUI.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];
cameraUI.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
[self presentViewController:cameraUI animated:YES completion:NULL];
}
if ([buttonTitle isEqualToString:@"Click a Picture"]) {
mediachecker=@"photo";
cameraUI.allowsEditing=YES;
cameraUI.sourceType=UIImagePickerControllerSourceTypeCamera;
[self presentViewController:cameraUI animated:YES completion:NULL];
//NSLog(@"UseCamera");
}
if ([buttonTitle isEqualToString:@"Photo Library"]) {
//NSLog(@"UseGallery");
mediachecker=@"photo";
cameraUI.allowsEditing=YES;
cameraUI.sourceType=UIImagePickerControllerSourceTypePhotoLibrary;
[self presentViewController:cameraUI animated:YES completion:NULL];
}
if ([buttonTitle isEqualToString:@"Cancel"]) {
}
}
- (void) imagePickerController: (UIImagePickerController *) picker
didFinishPickingMediaWithInfo: (NSDictionary *) info {
[picker dismissViewControllerAnimated:YES completion:nil];
//getting file here; and uploading
}
- (void) imagePickerControllerDidCancel: (UIImagePickerController *) picker {
[[picker presentingViewController] dismissViewControllerAnimated:YES completion:nil];
//dissming here;
}
我已经参考了这些链接 Redbar Noticed when dismissing UIImagePickerController
IPhone - After dismissing Modal View Controller - gap is left at top of page
但仍然遇到同样的问题。如何解决这个问题。
【问题讨论】:
-
您是否在标签栏添加了一些边缘插图?
-
不,我没有添加
标签: ios objective-c uinavigationcontroller uitabbarcontroller uiimagepickercontroller