gpt4 book ai didi

ios - UIImagePickerController 解雇时使用 UITabbarcontroller 获取带有应用程序名称的红色条

转载 作者:可可西里 更新时间:2023-11-01 06:14:32 27 4
gpt4 key购买 nike

我正在使用 UIImagePickerController 录制视频和拍照,编辑视频并将其保存到文件中。在关闭 UIImagePickerController 时,状态栏会闪烁红色并消失,有时我的标签栏会向下移动。无法理解为什么会出现这种情况。

enter image description here 我想避免这种情况。我一直在从 iOS8.1、iOS8、iOS7.1 等降低频率中注意到这一点

标签栏向下移动一段时间(意味着随机)。 enter image description here

为什么当我录制视频并上传到服务器或使用 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

但仍然遇到同样的问题。如何解决这个问题。

最佳答案

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

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

UIImagePickerController messing tabbar frame when dismissing

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

关于ios - UIImagePickerController 解雇时使用 UITabbarcontroller 获取带有应用程序名称的红色条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28722873/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com