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
Contributor
sivamurthyplaybook
Posts: 11
Registered: ‎06-14-2011
My Device: os 5 and above

Fix the image size and font size

Hi All

 

  We are developing a  Blackberry webworks application for  PLAYBOOK, in the playbook device application is working fine in potrait mode  when i am rotating the device to landscape mode  image size and font size changing( font size  and images are becoming big)  and reverse and same(when iam rotating from  landscape to potrait  font and images are changing). So, please help how to fix in both modes same(font size and image size).

 

 

Thanks and Regards

Siva.  

Regular Contributor
superfly_fr
Posts: 55
Registered: ‎12-23-2011
My Device: 9900 / PB 2.0641

Re: Fix the image size and font size

[ Edited ]

bumping it to bring a technical question over it.

 

Why are font sizes in static measurments (i.e "pt" or 'px") in every sample we have both for webworks and BBui, while it could (should ?) be in "em" or "%", to fit most ?
I could be wrong but W3c specs seems clearly in favor of "em" measurments (Read the "Good usage of CSS's font properties" in the doc linked below.), aren't we HTML5's generation devs ?

 

http://www.w3.org/QA/Tips/font-size

 

 

Developer
Puzzling
Posts: 51
Registered: ‎10-22-2011
My Device: 9800

Re: Fix the image size and font size

IMO:

 

While W3C covers a wide range of contexts, I think it is fair to say their focus is web pages displayed in browsers.  If you are trying to produce aesthetically pleasing layouts that are flexible across devices, browsers, window geometries and user font sizing then em and % can work well for fonts and related boxes.  In mobile web apps targeting a single device, many of these factors are fixed.  In addition the developer often doesn't want the user just scrolling down to overcome any deficiencies and may disable zoom.   By using absolute measurements, I can tightly control the layout down to a couple of pixels and ensure everything looks okay while using the full screen and no more.   Even it isn`t perfect due to descenders and the like but it is much better than leaving it up to the browser designer to decide how big the base font should be.   The "right answer" is probably a careful combination of the two.  Use px when you really do care about the size from a placement/intersection perspective.  Use % or em when you can accurately express what you want relative to something else.

 

Regular Contributor
superfly_fr
Posts: 55
Registered: ‎12-23-2011
My Device: 9900 / PB 2.0641

Re: Fix the image size and font size

[ Edited ]

Thanks puzzling for these inputs.

I'm experimenting some and I'll be back. But I don't want to mess the original post which subject was regarding images (sorry already for that sivaM). As soon as I have more experience, I'll make another topic for fonts and link it here.

Developer
Puzzling
Posts: 51
Registered: ‎10-22-2011
My Device: 9800

Re: Fix the image size and font size

sivamurthy - have you tried going in with webinspector when the device is in both orientations?   By looking at the specific elements, it should allow you to figure out the active part of the styling.

Regular Contributor
superfly_fr
Posts: 55
Registered: ‎12-23-2011
My Device: 9900 / PB 2.0641

Re: Fix the image size and font size

Since it's Jquery (but could apply to BBUI.js as well), I made a post (questionning) here https://forum.jquery.com/topic/everlasting-font-size-question about FONTS.