PDA

View Full Version : Hiding iPhone Safari address bar in .98 with the new application class



herkulano
2 Nov 2010, 1:44 AM
hi,

i refactored my application to use the new application, controller, routes classes and it is working great, but now the address bar does not hide in iPhone!

i had a look in the source code and in Ext.setup() there is some code to hide the addressbar and it works (see below).
i think, the problem is that in the application class there is no function to do this.



setup: function(config) {
if (config && typeof config == 'object') {
if (config.addMetaTags !== false) {
this.addMetaTags(config);
}

if (Ext.isFunction(config.onReady)) {
var me = this;
window.addEventListener('load', function() {
me.hideAddressBar.call(me);
}, false);

Ext.onReady(function() {
var args = arguments;
if (config.fullscreen !== false) {
Ext.stretchEl = Ext.getBody().createChild({
cls: 'x-body-stretcher'
});
Ext.stretchEl.setSize(window.innerWidth, window.innerHeight);
setTimeout(function() {
Ext.hideAddressBar(function() {
// document.body.addEventListener('touchstart', function() {
// Ext.hideAddressBar();
// }, true);
config.onReady.apply(me, args);
});
}, 250);
}
else {
config.onReady.apply(this, args);
}
}, config.scope);
}
}
},

hideAddressBar : function(callback, scope) {
window.scrollTo(0, Ext.is.Android ? 1 : 0);
if (callback) {
setTimeout(function() {
callback.apply(scope || this);
}, 300);
}
},

aaronwbg
11 Dec 2010, 1:02 PM
I have the same issue. After a lot of rework, I finally have an MVC pattern working, but now the address bar is persistent. I can't figure out why.

Have you resolved?

mrsunshine
11 Dec 2010, 2:04 PM
This is a already reported bug which will be fixed in Sencha Touch 1.0.2

aaronwbg
23 Dec 2010, 7:21 PM
This is a already reported bug which will be fixed in Sencha Touch 1.0.2

Fantastic, can't wait for the release.

mrsunshine
24 Dec 2010, 3:44 AM
Its also available in 1.0.1a. 1.0.2 is for Customers with Support subscription