how to fullscreen a Sencha Touch 2 page on a WebKit browser?

百般思念 提交于 2019-12-29 00:49:25

问题


When I visit http://www.wikpic.com/ on my Android-WebKit-browser the page renders on fullscreen, in other words the navigation bar that shows the URL disappear. How can I do that?

I tried this option but it doesn't work:

Ext.create('MyApp.view.MyList', {fullscreen: true});

This is my app.js code:

Ext.Loader.setConfig({
    enabled: true
});

Ext.application({
    models: [
        'Contacto'
    ],
    stores: [
        'Contactos'
    ],
    views: [
        'MyList'
    ],
    name: 'MyApp',

    launch: function() {

    Ext.create('MyApp.view.MyList', {fullscreen: true});
    }

});

Thanks!


回答1:


You are looking for the autoMaximize configuration for Viewport:

Ext.application({
    viewport: {
        autoMaximize: true
    },
    ...
});

Remember though that it may cause some issues (taken from the Sencha docs):

  • Orientation change performance is drastically reduced when this is enabled, on all devices.
  • On some devices (mostly Android) this can sometimes cause issues when the default browser zoom setting is changed.
  • When wrapping your phone in a native shell, you may get a blank screen.


来源:https://stackoverflow.com/questions/10316314/how-to-fullscreen-a-sencha-touch-2-page-on-a-webkit-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!