【问题标题】:UIImagePickerController when dismissed getting redbar with app name using UITabbarcontrollerUIImagePickerController 被解雇时使用 UITabbarcontroller 获取带有应用程序名称的红条
【发布时间】: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


【解决方案1】:

我在拍摄视频时遇到了 UIImagePickerViewController 关闭的相同问题:不要递归引用 Stack Overflow 链接,但这为我解决了:

尝试:“您应该在 .plist 中将“基于控制器的状态栏外观”值设置为 YES”

UIImagePickerController messing tabbar frame when dismissing

不知道为什么那个答案引用了这个,这里没有回答。

【讨论】:

    猜你喜欢
    • 2020-10-24
    • 1970-01-01
    • 1970-01-01
    • 2012-10-13
    • 1970-01-01
    • 2011-12-31
    • 1970-01-01
    • 2014-01-19
    • 1970-01-01
    相关资源
    最近更新 更多