Doubts in the Orientation of the screen

Hi guys, I'm developing my component. In it, I add the LabelField which displays the width of the screen, and when I change the orientation, the LabelField does not replace the old width of the labelfield, but may make changes to the things that are done in the paint while screen orientation.

How to change.

It's code

import net.rim.device.api.system.Display;
import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.Font;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.Manager;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import net.rim.device.api.ui.component.LabelField;

/**
 *
 * @author rakesh_2
 */
public class Component extends Manager
{
    LabelField ld;
    int val;
    String s,s1;
    Font ft,temp;
    Component()
    {
        super(Manager.FOCUSABLE);
        chk();
        ld=new LabelField(s);

        this.add(ld);

    }

    protected void sublayout(int arg0, int arg1)
    {
        chk();

        Field ff=this.getField(0);
        this.setPositionChild(ff, 5, 5);
        this.layoutChild(ff,Display.getWidth(), Display.getHeight()/2);
        this.setExtent(Display.getWidth(), Display.getHeight()/2);

    }
    public void chk()
    {
        val=Display.getWidth();

        s=String.valueOf(val);
        s1=s;
    }
    public void paint(Graphics g)
    {
        g.drawText(s, 15, 15);
        super.paint(g);
    }
    public void paintBackground(Graphics g)
    {
        g.setBackgroundColor(Color.LEMONCHIFFON);
        g.clear();
    }   

}

So how do you change the LabelField width on the orientation of the screen?

Concerning

Rakesh Shankar.P

The values returned by Display.getWidth and Display.getHeight need to change after the rotation of the screen.  Screen rotation may or may not change the size of a field.  For example a field cannot take the width of the screen in portrait or landscape mode, so you won't see any changes.

Tags: BlackBerry Developers

Similar Questions

  • Portege Z20T: Windows 10 - change the orientation of the screen don't work

    Hello

    in the instructions:

    Change the orientation of the screen
    When you use the computer in tablet mode, you can change the orientation of the screen of the computer on the side routing. The screen orientation automatically changes depending on the angle of rotation detected.

    But he won't!
    The operating system is windows 10.

    What can I do?

    This response from Toshiba is a scandal.

    Tut mir sehr leid, dass Sie eine negative Erfahrung mit your Toshiba Gerät machen track.

    Hotel der Themen-Komplexitat und moglicher necessary aufgebaute können Anfragen zur configuration und von the Installer (Treiber, operating system etc.) nicht immer completely by email where werden. WIR bitten daher UH Verstandnis.

    This use Sie bitte unsere umfangreichen online Supportangebote oder wenden Sie an unsere expert unter 0900-18674422 (1.56 Euro/Minute).

    If Sie noch questions haben, zögern Sie bitte nicht, Rubis mit each Kontakt aufzunehmen. You can reach each Montag bis Freitag von 8.00 Uhr bis 18.00 Uhr unter der 52 40 40 00 (0 21 31) telephone

    MIT thank wurde.

    A.i. EMI Service

    Who can help you, what does not help support? ??????????

  • Portege M700 will not change the screen orientation

    I installed the driver for the webcam for the M700, and every time I install it, I get the same error message:

    "Open Webcam driver fail - please restart camera or computer."

    I reinstalled the drivers of many times, and it still does not work.

    Therefore, I tried the msconfig method, disabled all the startup process and then reactivated their.

    The webcam shows the same error message, and now the screen will not change orientation when I rotate the screen.

    You try to use Windows XP Home edition or what? Generally, each laptop comes with preinstalled and configured operating system.

  • 21.5 inches a month old iMac had a pink line down the screen-oriented...

    21.5 inches a month old iMac had a pink line down the screen-oriented...

    Return it to the store for assessment.   It is in the warranty period of 12 months, so it could be replaced if you insist that you are in the United Kingdom.   Otherwise it is covered by your warranty and is either replaced or repaired according to the countries.

  • The orientation of the screen turned sideways!

    My dog stepped on the keyboard and the orientation of the screen is now sideways. How back to the normal orientation?

    Hello
    1. try Ctrl + Alt + arrow right key (or possibly left or up or down arrow.)
    2. go to display settings (from Control Panel or right click on the desktop) and look for an option to rotate the screen.
    3. check the system for an icon for Nvidia Control Panel or similar tray and look for the option "rotate screen" there.

    Hope this helps,
    Don

  • How to change the orientation of the screen back? Children changed his mind on the side?

    Hi, how can I change my screen orientation.  My child play with the computer and now I'm going to have to look at my laptop on the side.  The screen orientation East-West not North-South.  All suggestoins on where change setting? Thanks in advance

    Press CTRL + ALT + left arrow or CTRL + ALT + right arrow to rotate the image on the screen. Boulder computer Maven
    Most Microsoft Valuable Professional

  • Orientation of the toolbar - toolbar moving to the bottom of the screen

    original title: Orientation of the toolbar

    Hello, all. I am running windows XP - Home edition. Usually, the start menu and the toolbar are located at the bottom of the screen. For some reason, they moved to a wide column on the right side of the screen. It is difficult to handle, because I have a small screen, or to go to the top of the toolbar with the screen. How to restore it to its previous position. Thank you, David

    Right-click on the taskbar and unlock it. Take an empty place and slide it downwards. Place the cursor on the top edge of the taskbar, so it turns into a double arrow and drag it down to the desired height. Lock the taskbar.

  • change the orientation of the screen from vertical to horizontal

    I ran a quick scan on mcaffee and after I went to close my screen orientation went from vertical to horizontal, i.e. the top of the page to the right of the screen instead from the top of the screen.  How can I change this back?

    It is generally a function of your video card. With the help of the CTRL or the ALT key in conjunction with the arrow keys, you should be able to rotate the screen back. You can also try right clicking on an empty space on your desktop and search for context of graphics Options menu, graphics properties or something similar. Then look for Rotation or Orientation, or, possibly, landscape and Portrait.

    I hope this helps.

  • change the orientation of the screen?

    How can I change the orientation of the screen?

    Hello

    Try to press Ctrl + Alt + up ARROW, or try Ctrl + Alt + and a different key to the arrow.

    If this does not work: right-click on empty office rotation - graphics options.

  • To adapt to the screen orientation by using javascript (for playbook)

    Hi all

    I know that the subject of the screen orientation has been crossed many times already, but I've searched and searched in the webworks put on an answer and can't find it.

    My application is made for the landscape. I have 2 options. ((1) lock app in landscape which I think still can be done using webworks (but please correct me if I'm worng) or 2) to scale the app for the portrait.

    Because to my knowledge 1) cannot be done, I'll focus on 2). Has anyone seen or written a javascript/css script that checks if the user holds the tablet in landscape or portrait and adapt to the 2 on-the-fly switching of b/w? My app is made for 1024 x 600. I know it can evolve using CSS 0.6 starting to adapt to the screen, but I don't know how to check and then re - evolve afterwards with javascript.

    Any help, please and thank you.

    In fact, you can lock in landscape orientation with

    your config.Xml file. Just remove the space after "rim:" because I added it to prevent the Bulletin Board to return as , haha.

  • How do change scrollViewProperties scrollMode from vertical to horizontal so change the screen from portrait to landscape orientation

    How to change scrollViewProperties scrollMode from vertical to horizontal if the orientation of the screen change mode portrait mode to landscape?

    I try like this, but not work

    {OrientationHandler}
    onOrientationAboutToChange: {}
    If (orientation is UIOrientation.Landscape)
    scrollViewId.scrollMode = ScrollMode.Horizontal; scrollViewId-> id scrollView
    on the other
    scrollViewId.scrollMode = ScrollMode.Vertical;
    }
    }

    Thank you

    Hi, I changed the code like this and works

    {OrientationHandler}
    onOrientationAboutToChange: {}
    If (orientation is UIOrientation.Landscape)

    scrollViewId.scrollViewProperties.scrollMode = ScrollMode.Horizontal;
    on the other

    scrollViewId.scrollViewProperties.scrollMode = ScrollMode.Vertical;
    }
    }

  • restrict the orientation of the screen

    Hello

    Is there anyway I can limit the orientation of all the screen in the application in one place only to call the restriction to before each screen to push?

    See you soon

    call once and it is fixed for the entire application.

  • How to set the orientation of the screen

    Hello

    I don't have the time to support portrait and landscape for my application now... :-(

    I used the trick, like y = 601 to hide things. (I know the visible property, but for the same reason, do not use it)

    But I realized that if the playbook turns to the portrait and auto-size of the unit itself, my trick won't work no more... (and it will be very funny... Unfortunately, Simulator did not support orientation for testing)

    So, for the configuration of the xml file, there's a parameter as:

    fake

    in order to avoid the automatic orientation.

    But, I can't find a configuration setting to 'force' and the screen always Frizz in landscape mode (1024 x 600).

    What are the settings to force the application always on 1024 x 600?

    Thank you.

    You can do this in the root Sprite parameter, by

    [

    [ SWF (height ="1024", width ="600", frameRate ="30", backgroundColor ="#000000")]

     

    Most of the people are locking in landscape mode, until the Simulator supports or they get their PB.

  • Deactivation of the orientation of the screen for my application.

    Hello Sir/Madam,

    Please tell me how can I disable the orientation of the screen as my app looks good horizontally. Thanks in advance.

    Kind regards

    Sandesh

    This can be achieved by adding the code to your file config.xml below

    
    

    Please see the link for more details below. http://docs.BlackBerry.com/en/developers/deliverables/27280/Widget_element_834671_11.jsp

  • orientation of the screen from locking/unlocking code

    I know that we can lock the screen orientation by setting autoOrient false tag in the xml file.

    I want a certain vision in my application must be blocked to the landscape, while another view to lock on the portrait, and others without orientation lock. Is it possible to do? Or I have to manually manage it me via OrientationChangeEvent?

    Thank you

    AutoOrients is not something you can change during execution (unfortunately), so your only option is to allow it, listening for the orientationChange event and in some cases of preventDefault() on it.

    Peter is right, but the solution seems a bit more complicated than it should be, probably because it targeted AIR 2.5, where they took setOrientation() API for a reason any...

    If you target AIRT 2.7, stage.setOrientation () should be all you need to use to manually set the direction, IE when the view is loaded, you manually set the direction landscape and preventDefault on all the orientation changes. Then, when the view is dropped, you setOrientation() to what it was previously and allow events to pass by...

Maybe you are looking for

  • Ubuntu updates are blocked

    I'm trying to update my current Ubuntu operating system and an update of the printer driver. System says check internet connection. Fetch failed?

  • Satellite A30 - Wifi PCMCIA does not work

    Hello, please help.I connected a PCMCIA Wifi Netgear card for wireless access. Unfortunately, even if I get all the signs that I am connected, internet Explorer will not access the internet. I checked all firewall and antivirus, etc...Here, I get a s

  • Always open Windows Explorer in maximum mode

    When I goto Windows Explorer I always open with maximum vision.For the moment, it opens in smaller mode and I have to click the view max.How can I always open in the view max? Arthur H

  • Windows Mail - Compact messages in the Inbox

    Our windows mail asking us if we want to compact messages in the Inbox. I don't want this prompt accidentally when someone clicks Yes all our messages go somewhere and I don't know how to get them. Where they go and how can I get back them. We have p

  • icon background is not in task switcher

    Trying to place my application Ui in the background using UiApplication.getUiApplication.requestBackGround (), app is taking place in the background, but it is not getting displayed in the list applications in the screen of task switch which is on th