PDA

View Full Version : Ext.regApplication doesn't hide iPhone location bar



estesbubba
3 Dec 2010, 7:40 AM
I switched my application from Ext.setup() to the MVC model using Ext.regApplication(). One thing I noticed is the location bar on my iPhone no longer hides. After a lot of tracking down, I created simple cases to prove this.

Ext.setup():
23657


<html>
<head>
<!-- Ext Touch CSS -->
<link rel="stylesheet" href="${resource(dir:'css/sencha',file:'sencha-touch-debug.css')}" />

<!-- Ext Touch JS -->
<g:javascript library="sencha/sencha-touch-debug" />

</head>

<body>
<script language="javascript">
Ext.setup({
onReady: function() {
new Ext.Panel({
fullscreen: true,
style: "background: yellow;",
html: "content here"
});
}
});
</script>
</body>
</html>

Ext.regApplication():
23658


<html>
<head>
<!-- Ext Touch CSS -->
<link rel="stylesheet" href="${resource(dir:'css/sencha',file:'sencha-touch-debug.css')}" />

<!-- Ext Touch JS -->
<g:javascript library="sencha/sencha-touch-debug" />


</head>

<body>
<script language="javascript">
Ext.regApplication({
name: 'MyApp',
useLoadMask: true,
launch: function() {
new Ext.Panel({
fullscreen: true,
style: "background: blue;",
html: "content here"
});
}
});
</script>
</body>
</html>

I looked and couldn't find a setting in Ext.Application to change this. Am I missing something or is this possibly a bug?

Thanks.

mrsunshine
3 Dec 2010, 8:24 AM
Its a bug / problem wit Ext.Application, it does not init the Ext.Viewport oobject which is responsible for the fullscreen mode.

you have to do something like this, to have fullscreen


Ext.regApplication({
name: 'MyApp',
useLoadMask: true,
launch: function() {
Ext.Viewport.init();
new Ext.Panel({
fullscreen: true,
style: "background: blue;",
html: "content here"
});
Ext.Viewport.onOrientationChange();
}
});



its not the nicest way but a workaround until Ext Application supports ullscreen by default

estesbubba
3 Dec 2010, 8:59 AM
Thanks for the reply. That worked for my example above but I can't get it to work in my app that uses Ext.dispatch().


Ext.regApplication({
name: "Mobile",
defaultTarget: "viewport",

icon: 'client/mobile/images/LexarWebClip.png',
phoneStartupScreen: 'client/mobile/images/phoneStartupScreen.png',
fullscreen: true,
glossOnIcon: true,

launch: function() {
var params = Ext.urlDecode(location.search.substring(1));

// Force to phone (for development)
if (Ext.isDefined(params.forcePhone)) {
Ext.is.Phone = true;
}

// Shortcuts

// Prototype overrides

// Remove any initial body content like Loading...
Ext.getBody().setHTML('');

Ext.Viewport.init();
this.viewport = new Ext.Panel({
fullscreen: true,
application: this
});

Ext.dispatch({
controller: 'Login',
action: 'show'
});
Ext.Viewport.onOrientationChange();
}
});

estesbubba
6 Dec 2010, 7:16 AM
Cleared cache like 5 times on Friday and still had the problem. Came in today and now my location bar is auto-hiding. Maybe the iPhone clear cache takes a while...

Thanks for the tip - it's working now.