I'm developing a widget for mobile phones using the Vodafone Mobile Widget Platform and I'm trying to get it to fill the entire screen. Using height and width to 100% doesn't seem to work as expected. Anyone know what to do?
Ok, try this:
function resizeWidget() {
var availWidth = screen.availWidth;
var availHeight = screen.availHeight;
window.resizeTo(availWidth, availHeight);
}
Check out this document for more info: http://widget.developer.vodafone.com/docs/Different-Resolutions-on-Mobile-Phones-v0.3.4.pdf
During the execution of a widget, the resolution of the phone can change. For example, newer mobile phones have sensors to detect whether the phone is held horizontally or vertically. The Vodafone Apps Manager recognizes such changes and fires a resolution-event every time there is a change. To make sure your widget is resized every time the resolution changes, you can add an event listener for the resolutionevent and use the resizeWidget() function as event handler:
widget.addEventListener('resolution', resizeWidget, false);
Additionally, you should call the resizeWidget-function when the widget starts, because a user could start the widget in landscape mode. As the runtime does not raise a resolution-event when this happens you have to call the resizeWidget-function manually.