no status bar in phone gap?

后端 未结 4 526
半阙折子戏
半阙折子戏 2021-01-02 21:25

I have been trying to get the status bar to go away as i want to put a fullscreen game in. i\'m using phonegap for the iphone

thanks in advance.

4条回答
  •  醉酒成梦
    2021-01-02 22:17

    For iPhone simply add

    UIStatusBarHidden
    
    

    in your [appname]-info.plist file

    For completeness if you also wish to roll out for android this solution worked well

    In the file where you change activity to droidgap

    public class app extends DroidGap
    

    Add the following import

    import android.view.WindowManager;
    

    And then append the following within the class method

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    
        getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
        WindowManager.LayoutParams.FLAG_FULLSCREEN);
    
        super.loadUrl("file:///android_asset/www/index.html");
    }
    

    Hope this helps

    regards

提交回复
热议问题