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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Contributor
Posts: 34
Registered: ‎08-01-2012
My Device: Playbook
My Carrier: None
Accepted Solution

Auto resize and layout?

On rotation, does WebWorks have any support for auto resize or layout?  Or when I get a rotation event, do I have to manually move things around to fit the new orientation?

Highlighted
Developer
Posts: 192
Registered: ‎09-23-2009
My Device: 9860/PlayBook/Dev Alpha
My Carrier: Plus GSM

Re: Auto resize and layout?

If you have layout based on percents, and width of main container set to 100% (all other sizes as relative), then during rotation screen will fit to new width reformating webworks page

 

I'm not sure, but on newer devices css media query should work as they are part of the standard, so you could have autoadjusting layout which will follow rotation changes (by example action bar hiding when in portrait mode, or moving itself to right).

Found my post helpfull? Like it! It solves your trouble? Help others and accept it as solution. Search before asking.
My apps: Secret Cod3s | Should my tablet be banned?
--
Jakub Nietrzeba
PGS Software S.A.
Your reliable partner in Poland - IT Outsourcing - BlackBerry, iPhone, Web and Standalone applications
Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Auto resize and layout?

Great answer gluth!

 

I wanted to add a few comments of my own:

 

The Web engine will automatically try to resize your content when you change the orientation of the device.  If you have a good viewport, and as gluth mentioned, are using relative sizing then it should scale according to the new screen width.

 

However, you can also listen for the orientation change event:

http://blackberry.github.com/WebWorks-Samples/kitchenSink/html/browser/orientation.html

 

Finally, media queries are supported on PlayBook and BlackBerry 10 Dev Alpha.  These powerful techniques makes it easy to design CSS for different screen orientations:

http://blackberry.github.com/WebWorks-Samples/kitchenSink/html/css3/mediaquery.html

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.