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

Java Development

Reply
Developer
Posts: 142
Registered: ‎06-26-2009
My Device: Not Specified

Orientation issue in touch devices.

Hi All,

 

AFAIK on screen orientation change sublayout method is called so accordingly i managed to set the width and height for screen managers and other fields.

 

In my screen there is background image in verticalfieldmanager and adding other fields like textboxfield, labelfields and custom buttons to it.

 

The orientation works well when say i was in potraite mode and change to landspace properly it renders the its fields on screen.

But when i was in landscape mode and change to potrait, fields get renders properly in landscape but when i move to potraite the fields size doen't get any change all fields go out of screen specially textboxfield.

 

 

Please need help on this issue.

 

Thanks,

Siddh

BlackBerry Development Advisor
Posts: 15,078
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Re: Orientation issue in touch devices.

What BlackBerry Smartphone model and BlackBerry device software version are you testing on?  You can find this under Options, About on the BlackBerry Smartphone.

 

Can you post some sample code that shows your implementation?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 142
Registered: ‎06-26-2009
My Device: Not Specified

Re: Orientation issue in touch devices.

Hi,

 

Thanks MSohm for your reply. Now my problem is solved

 

Testing on device 9800 - OS v6.0.0.141 and 9550 - OS v5.0.0.535.

 

I have implemented one custom VerticalFieldManager with bitmap image, it gets scale to device resoulution  and paints the background. I have added defalult Vertical and HorizontalField Managers with it FIELD_HCENTER parameters wherever required and then added other fields to those managers.

Most of the screens in my application has its fields in center.

 

Using this it works as i explained in my above post.

 

To work it in all orientations i have  implemented custom Horizontal and VerticalField Managers to place the fields in center. Now using those managers it works fine in all orientations.

 

I just want to knw in my previous case why fields get rendered properly with portraite to landscape and not with landscape to portraite.

 

Thanks,

Siddh

 

 

 

 

 

Developer
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: Orientation issue in touch devices.

My guess is that somewhere in your code you are storing a width and using that in calculations after the screen orientation changes. Could you post some code that demonstrates the problem?




Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.
Developer
Posts: 112
Registered: ‎04-28-2010
My Device: 8520
My Carrier: AirTel

Re: Orientation issue in touch devices.

hi dear,

 

whenever device orientation changed, there sublayout method of the screen and paint() method called.

you can use both method for orientation change problem. first check Display.getOrientation() which returns the ORIENTATION_PORTRAIT or ORIENTATION_LANDSCAPE etc., if found then change layout or paint screen according to that. Guys its really work, I have already used.

 

-DK