gpt4 book ai didi

ios - subview 中的 UIImagePickerController > 不是全屏

转载 作者:行者123 更新时间:2023-11-28 17:57:30 25 4
gpt4 key购买 nike

我正在尝试将 UIImagePickerController 作为 subview 添加到我的 rootviewcontroller 中,以便相机显示在主应用程序区域内,不是作为覆盖。这是我的代码:

-(void)cameraSetup{
CGRect bottomBarFrame = CGRectMake(0, self.view.frame.size.height-UA_BOTTOM_BAR_HEIGHT, self.view.frame.size.width, UA_BOTTOM_BAR_HEIGHT);
self.bottomNavBar = [[BottomNavBar alloc] initWithFrame:bottomBarFrame leftIcon:UA_ICON_PHOTOLIBRARY withFrame:CGRectMake(0, 0, 45, 22.5) centerIcon:UA_ICON_TAKE_PHOTO withFrame:CGRectMake(0, 0, 90, 45)];

//create a new image picker instance
picker = [[UIImagePickerController alloc]init];
picker.delegate = self;
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]){
//set source to video!
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
//hide all controls
picker.showsCameraControls = NO;
picker.navigationBarHidden = NO;
picker.toolbarHidden = YES;
picker.editing = NO;
//make the video preview full size
//picker.wantsFullScreenLayout = YES;

picker.cameraViewTransform = CGAffineTransformScale(picker.cameraViewTransform,1, 1);

[picker.view addSubview:self.bottomNavBar];

picker.view.frame=CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height-(UA_TOP_WHITE+UA_TOP_WHITE-bottomBarFrame.size.height));
[self.view addSubview:picker.view];
[picker viewWillAppear:YES];
[picker viewDidAppear:YES];

}else{
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Test Text" message:@"Camera is Not Availble" delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil];
[alert show];
}
}

即使我将选择器的框架设置为不全屏,它也总是全屏显示。有没有办法摆脱这种行为?还是有其他选项可以在选择器顶部显示我的 BottomNavBar

最佳答案

UIImagePickerController 用于当应用程序需要访问系统资源(例如相机 甚至用户照片库)时使用。由于它们 UIImagePickerController 以受控方式启用系统访问,因此很明显您无法对其进行自定义。

关于ios - subview 中的 UIImagePickerController > 不是全屏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21627936/

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