javascript - How do I hide the iOS7 status bar when returning from PhoneGap Camera API? -


I have come across a problem when using Cordova / PhoneGap to create an app for iOS7. Can not hide very well.

Initially I went to the plug in the encode and added all the correct settings to make the status bar invisible in this solution.

It works great until I hit the Cordova camera with the API. When I take my app to go to the Camera app to take an app (then put it in the screen). Once the image is selected and returned to the app, the status bar is visible again.

I have installed the status bar Cordova plugin and I am trying to hide the status bar as soon as he returned, the camera device in my device surprised - it does not work! However, I can enable a button that enables a button to hide the status bar when I click on it - but I want it to happen automatically.

I have inserted my code below:

  div id = "ccamera-fun" data-role = "page" data-title = "camera fun activity" & gt; ; & Lt; div data-role = "header" data-theme = "e" & gt; & Lt; a href = "#" data-relay = "back" data-theme = "h" data-icon = "arrow-el" data-direction = "reverse"> Back & lt; / A & gt; & Lt; H1 & gt; 3.5 years - 4.5 years & lt; / H1> & Lt; / Div & gt; & Lt; Div data-role = "content" data-theme = "a" square = "content" & gt; & Lt; H1 & gt; Camera Fun & lt; / H1> & Lt; Div id = "imageContainer" & gt; & Lt; / Div & gt; & Lt; P & gt; Use your photos and ask your child to describe one in detail. Use your photos as photos of photographs where your child can share his memories and remember events before or after taking pictures. & Lt; Strong> Together you can invent your story. & Lt; / strong> & Lt; / P & gt; & Lt; P & gt; Take a picture with your phone using the buttons below or choose an image from your phone's photo library. Once you select a photo, it will be embedded at the top of this screen. & Lt; / P & gt; & Lt; Script type = "text / javascript" charset = "UTF-8" & gt; Hide functionstats () {StatusBar.hide (); Navigator.notification.alert ("hide status bar"); } Function lephoto () {navigator.camera.getPicture (onCameraSuccess, onCameraError, {quality: 50, destination type: Camera.DestinationType.FILE_URI}); } Function on cameras (imageURL) {// Status status image position status. HID (); // image container DIV ic = document. GetElementById ('imageContainer') handle one; // Again using the URL using the URL, the application of the camera to use the INCPPener HML = '& lt; Img src = "'+ imageURL +'" width = "100%" /> ;;;;;; Navigator.notification.alert ("onCameraSuccess:" + imageURL); } Camera error at function (e) {console.log (e); Navigator.notification.alert ("onCameraError:" + e); } Function fromAlbum () {navigator.camera.getPicture (onLibrarySuccess, onLibraryError, {Quality: 50, sourceType: Camera.PictureSourceType.PHOTOLIBRARY, allowEdit: true, destinationType: Camera.DestinationType.FILE_URI}); } Function onLibrarySuccess (imageURL) {// Image Container DIV ic = document. GetElementById ('imageContainer') Take a handle for it; // Then we use the ic.innerHTML file from the camera application; write an image tag out for DIV '  

If someone can tell me where I am going wrong with this I would appreciate it.

Thanks

itemprop = "text">

This is a phonegap bug, refer to:

You can fix this by adding

  [[UIApplication shared application] setStatusBarHidden: Yes];   

until the end of the imagePickerController: didFinishPickingMediaWithInfo: which remains

However in CDVCamera.m, the above code is just a quick fix for you, consider this In the all-round, you should test it for yourself.

I hope this helps you!

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -