开发者

Hiding UIToolBar when calling camera (UIImagePicker)

开发者 https://www.devze.com 2023-01-08 00:43 出处:网络
I have created a UIToolBar using the IB.In one view, I have called the camera and the camera controls are masked by the toolbar.

I have created a UIToolBar using the IB. In one view, I have called the camera and the camera controls are masked by the toolbar.

I have tried several methods to hide the toolbar - alpha=0, toolBarHidden, hidesBottomBarWhenPushed and thought how I could re-size the camera view to allow the camera controls to be used. All with no luck.

I believe I must create a custom toolbar and then I can use the hide method.

My camera code is the standard:

UIImagePickerController *imagePicker = [[UIImage开发者_开发问答PickerController alloc] init];
imagePicker.sourceType =  UIImagePickerControllerSourceTypeCamera;
imagePicker.allowsEditing = NO;
imagePicker.delegate = self;            
[self presentModalViewController:imagePicker animated:YES];

Any code or final direction would be appreciated from this newbie.


Try to shift the toolbar off the screen by changing the frame of it by providing y cordinate more than 480 for iphone.


Use this to "hide" the toolbar. It removes the standard "take picture ,etc" buttons and replaces it with a black bar with the same width/height of the default overlay.

imagePicker.showsCameraControls = NO;

iOS reference

0

精彩评论

暂无评论...
验证码 换一张
取 消