no status bar in phone gap?

后端 未结 4 459
半阙折子戏
半阙折子戏 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:01

    If you want to the app to load with the status bar initially hidden:

    • [appname]-info.plist file
    • Find "Status bar is initially hidden"
      • Add new row if it isn't already there
    • Select 'YES' for the value

    "Status bar is initially hidden" is the key that is available at least in xcode 4.2 beta 5.

    0 讨论(0)
  • 2021-01-02 22:07

    You can try:

    1) call this:

    [[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO]
    

    2) or this from your view controller.

    [self setWantsFullScreenLayout:YES];
    

    3) You can do it from the Interface Builder. Here's a video about it: http://www.youtube.com/watch?v=aPAChohC-4Q

    4) Someone else asked the same thing and got some related answers: Fullscreen UIView with Status bar and Navigation Bar overlay on the top

    0 讨论(0)
  • 2021-01-02 22:10

    For iOS7, you'll need to set the following setting in your [appname]-info.plist:

    'View controller-based status bar appearance' to NO (Boolean)

    0 讨论(0)
  • 2021-01-02 22:17

    For iPhone simply add

    <key>UIStatusBarHidden</key>
    <true />
    

    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

    0 讨论(0)
提交回复
热议问题