我有一個自定義UIView,我已經創建顯示我的自定義按鈕和工具欄。當我第一次要求它顯示時,酒吧位於快門頂部(這很好)。但是在相機裝入後,快門會在它前面出現,然後打開。相機快門出現在自定義UIView?
如果你看看本機camera.app,它不會這樣做。工具欄停留在整個時間。這裏是我的代碼:
// .h
UIImagePickerController *theCamera;
@property (nonatomic, retain) UIImagePickerController *theCamera;
// .m
theCamera = [[UIImagePickerController alloc] init];
theCamera.delegate = self;
theCamera.sourceType = UIImagePickerControllerSourceTypeCamera;
theCamera.showsCameraControls = NO;
theCamera.toolbar.alpha = 0;
theCamera.navigationBarHidden = YES;
theCamera.toolbarHidden = YES;
theCamera.wantsFullScreenLayout = YES;
theCamera.cameraViewTransform = CGAffineTransformMakeScale(1.25, 1.25);
UIImageView *tabBarBack = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"tab_bar_back.png"]];
tabBarBack.frame = CGRectMake(0, 422, 320, 58);
[customView addSubview:tabBarBack];
theCamera.cameraOverlayView = customView;
[self presentModalViewController:theCamera animated:YES];
顯然有更多的按鈕,我添加到customView
,但你的概念。