Hide browser address bar in Sencha Touch 2 app

Hello,

This is quick blog on how to hide browser address bar in sencha touch 2 app.

You need to specify autoMaximize propery of view port in the application. Checkout following code.

Ext.application({
                            name: ‘MyApp’,
                            icon: ‘resources/images/icon.png’,
                            tabletStartupScreen: ‘resources/images/tablet_startup.png’,
                            phoneStartupScreen: ‘resources/images/phone_startup.png’,
                            glossOnIcon: false,
                            viewport: {
                                autoMaximize: true
                            },
                            models: [‘MyModel’],
                            stores: [‘MyStore’],
                            views: [‘MyView’],
                            controllers: [‘MyController’],
                         
                            launch: function () {

                                   Ext.Viewport.add({
                                                        xclass: ‘ MyApp .view. MyView’
                                  });
                           }
                });

That’s it and open the application in any mobile browser, it will hide the browser address bar. Please note that this trick will only work for mobile browsers.

This entry was posted in Uncategorized on by .

About Hiren Dave

Hiren Dave is a software engineer, blogger and consultant with over 9 years of professional experience. He writes code in number of languages. Hiren has a passion for developing web apps, mobile apps and writing books and blog articles about programming. He has a solid experience of startups as he manages products for few startups. He is also passionate about researching and learning new technologies and trends. He has also authored a book Instant Sencha Touch, published by Packt and creator of Video Course "Beginning Laravel" for Packt

1 thought on “Hide browser address bar in Sencha Touch 2 app”

Leave a Reply

Your email address will not be published. Required fields are marked *