Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Contributor
Posts: 2
Registered: ‎05-14-2013
My Device: Bold 9900
My Carrier: 6175132052

Webworks Viewport Width Issues

[ Edited ]

On the Blackberry Bold 9900 running 7.1 Bundle 998 (v7.1.0.284, Platform 5.1.0.230) I am having a strange viewport related issue.

 

I am non-deterministically seeing screen.width alternate between 320px and 356px.

This affects the behavior of rendered content because I have a

 

<body><div style="width:100%"></div></body>

that approx 50% of the time renders correctly (i.e. no horizontal scroll), but the rest of the time renders zoomed in and scrolls horizontally by 36px. Setting a fixed width on the body i.e. 320px causes the zoom issue to be resolved, but still has a white scrollable area on the right side.

 

See http://stackoverflow.com/questions/16546208/webworks-viewport-width-issues

 

Developer
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: Webworks Viewport Width Issues

The device is 640x480 so you need a meta to make it behave

 

Viewport should be aomething along these lines

 

user-scalable=no,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,width=device-height,width=device-height

 

This meta will change your numbers

 

Now you've got a rotation issue (it's still damned annoying)

 

Device browsers report their INITIAL size - not the real one

 

You need to trap both initial height and width along with orientation

 

Armed with that info on a resize or orientation event you can adjust and reflow the HTML to fit the screen




Click the like button if you find my posts useful!
New Contributor
Posts: 2
Registered: ‎05-14-2013
My Device: Bold 9900
My Carrier: 6175132052

Re: Webworks Viewport Width Issues

Peardox,


I am already using that viewport setting, but the reported size is incorrect.

Developer
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: Webworks Viewport Width Issues

Try this - https://github.com/peardox/bbww10ext-release

 

I ain't finished this bit yet but you should get the idea

 

https://github.com/peardox/kbstuff/blob/master/nores/kb001.txt

 

 




Click the like button if you find my posts useful!