Vertically Center a LabelField several lines on a screen

Hello

I am trying to vertically align a LabelField several lines on a screen.  This turns out to be more difficult than it should be.  I am calculating the upper margin of the LabelField with:

int topEmptySpace = (Display.getHeight() - label.getPreferredHeight()) / 2;

label.setMargin(topEmptySpace, 15, 0, 15);

It works, but only if the text in the LabelField is a single line.  When it becomes multi-line, getPreferredHeight() value does not change, and therefore the LabelField is not perfectly in the Center.  I saw a couple other posts about it, without a solution...

Thoughts?  Thank you!

Because getPreferredHeight is just a suggestion. A field can know its peak that it is laid out. It is too late for setMargin (in general - there are all kinds of tricks). Fortunately, you can easily calculate the actual height your aura LabelField - multiply its getPreferredHeight by ( + 1). Unlike many other text fields, LabelField never Word encapsulates and respect only line breaks.

Tags: BlackBerry Developers

Similar Questions

  • Qosmio G15: Green vertical lines on the screen

    All started an ordinary day, when I was playing music on my iTunes.
    All of a sudden my screen went black and the music stopped, but my power button is always blue. Since then, whenever I try to start it, it goes on the Qosmio screen and Windows XP screen and plays the startup sound, but there all those green vertical lines on the screen. And then it goes black and tsays in this way.

    I was able to use Windows VGA (whatever that means) with lines all over the screen, but I am not able to start normally. Does anyone have any suggestions or have had the same problem? Please help me!
    I have a Toshiba G15 Windows XP Media Center, but am not able to use it normally.

    -Alexis

    Hello

    You can enter operating system in SafeMode using F8 t the beginning upward?

  • Insert several lines with dynamic data

    Hello
    When I do an insert into a table that has several lines of dynamic information. on
    a page, it inserts all rows that are dynamically filled. I want only what he
    to insert the lines that I choose the initials on. How can I do? Let's say I
    have 5 items that are displayed on a page and I want to insert only original
    the first 2 because the last 3 are left blank, how should I do this? I tried
    implementation of an if statement that says:

    < cfif "form. "Help of # PNR_Approval_Initials #" NEQ "" > "".

    Then make the insertion in the table

    < cfelse >
    < / cfif >

    I have this game were also up in a loop that says:

    < cfloop index = "help" list = "" #form.listofids # "delimiters =",">"

    Here is the code for just the insertion. I also have a code here
    Update another table. I got this to work, so I just try to get the insertion
    works fine for the moment. I can not use this where the query statement:
    Where ItemID = #id # because I'm trying to insert into the table of approval, not
    the items table. The table is just updated with some other info. in
    a few other input boxes.

    < cfloop index = "help" list = "" #form.listofids # "delimiters =",">"
    < cfif "form. "Help of # PNR_Approval_Initials #" NEQ "" > "".

    < cfquery Datasource = '#application. DataSource #">"
    Insert into accreditation (APV_ItemID,
    APV_ECID,
    Document_Type,
    Approval_Initials)

    Values (' #Evaluate ("form.) (' ItemID # help # ") #',
    ' #Evaluate ("form. ("ECID # help #") #',
    < cfif isDefined (form '. ') ("Help of # PNR_Doc_Type # ') and
    "form. "Help of # PNR_Doc_Type #" NEQ "" > "".
    ' #Evaluate ("form. ("Help of # PNR_Doc_Type # ') #',
    < cfelse >
    NULL,
    < / cfif >

    < cfif isDefined (form '. ') ("Help of # PNR_Approval_Initials # ') and
    "form. "Help of # PNR_Approval_Initials #" NEQ "" > "".
    ' #Evaluate ("form. (Aide de # PNR_Approval_Initials #») #
    < cfelse >
    Null value
    (< / cfif >)

    < / cfquery >

    < / cfif >
    < / cfloop >

    On the page display, just a table of dynamic info. Here are the 4
    things that I have on this page that needs to be inserted to the database.

    < input type = "hidden" name = "' ECID #ItemID #" value = "#ECID #" > "
    < input type = "hidden" name = "' ItemID #ItemID #" value = "#ItemID #" > "
    < input type = "hidden" name = "" PNR_Doc_Type #ItemID # ' value = "PNR Req" > "

    < td align = "center" >
    < cfif Approval_Initials is not "" > "".
    #Approval_Initials #.
    < cfelse >

    < select name = "PNR_Approval_Initials #ItemID #" >
    < option value = "" > select initials < / option >
    < cfloop query = "ShowInitials" >
    < Cfif Engineer_Initials EQ 1 >
    < option value = "#Initials #" > #Initials # < / option >
    < / cfif >
    < / cfloop >
    < / select >

    < / cfif >
    < table >

    Can someone help me please on just the insertion in the database so that it
    will insert on the lines that I chose the initials on and not others? Thank you.

    Andy

    You almost managed, but I see that you have commented.

    (" The help of # PNR_Approval_Initials # ') AND form ["PNR_Approval_Initials # help #" ""] NEQ "" >

    Do things here

  • Satellite M70-339 vertical lines on the screen

    Hello...

    I have a Satellite M70-339, which will show only the vertical lines on the screen.
    I connected an external monitor and booted in safe mode.
    I uninstalled the display drivers.
    I started to monitor and reinstalled the display drivers.
    The computer will now boot up screen.

    I put the display to indicate to both monitor and screen.

    On the monitor, all right.
    On the screen, I get vertical lines color, similar to a wallpaper (wallpaper is not pretty).

    Did anyone has got any ideas what could be the problem, or how to diagnose the problem
    Any help would be appreciated.

    John C

    If everything is OK on the external monitor that is the best evidence that this problem is related to the internal LCD. Display must be exchanged.

  • Qosmio G10 has vertical lines on the screen

    I have a G10 which I use for the last 15 months since I bought it.
    However, there are now 4 vertical lines on the screen, 2 Purple (magenta?), 1 yellow and 1 cyan. Other than these lines there are no other problems, it never fell down or something like that.

    The lines are still there, they do not change in any way and are always in the same place. They appear on the screen at first power up, before the Qosmio logo lights up.

    They have not all appear at the same time, they all appeared individually in the past two months. I've seen the last of them disappear briefly, then stay on.

    I guess that my screen is dying slowly, I guess to be an expensive item.

    Any advice thrown my way would be greatly appreciated!

    I took a picture of the screen you will find at:

    http://www.imagebucket.NET/images/lldata/displaylines.jpg

    Note: the photo was taken with Media Player full screen on a black image, just to clearly show the lines)

    Hello

    I suggest you connect an external display to check if it's a graphics card or a display problem. If cela pipes appears also on the external screen then it could also be a problem with the graphics card.
    If these lines do not appear on the external display while the display of the laptop has a malfunction.
    However, this does not change your situation. I recommend you contact the Toshiba ASP to solve this problem.

  • Qosmio G10 begins with vertical lines on the screen

    Hello, can anyone help?

    When I try to start my sign qosmio G10 comes on with vertical lines on the screen. And the screen goes black and I can only hear the fan.
    In VGA mode, it begins upward, but always with the lines on the screen.
    Is there something wrong with the video card? In my view, that there are more people with this problem.
    Toshiba offered little help?

    I'm 'out out of warranty '. I need to by a new complete motherboard or y at - it another option? Replace the video card?

    Hello

    Its a shame about the warranty because you ask the service partner Toshiba for the verification of the laptop and this procedure would be free. You know, the warranty would cover the audit of the laptop.

    But I would say the external display connection and then you can check if the same vertical lines appear on the external display.
    If you see the lines on the second monitor, then I guess it could be something wrong with the graphics card or motherboard.

    I think that this procedure is the best way to find out what could be the problem, but anyway, I think you should ask a technician for assistance if you want to solve this problem.

    PS: Have you tried to reinstall or update the graphics driver? I think you should do it but I don't know if it will help you, but you know Mr. try is free ;)

    One of my friends had a similar problem with the vertical lines on other mobile manufacturing, and it was a WLan cable which was responsible for the strange lines on the screen.

  • Qosmio F10: vertical lines on the screen

    I use a Qosmio F10 with a nVIDIA 128 MB graphics card. Recently while I was running a graphics-based application on, my screen started showing me wire colors on the screen. I was able to start the game once more, but found the same problem exist.

    On reboot, the system showed the vertical white lines on the screen to start qosmio, ' *' on the lines of the bios password screen and green on the Windows XP loading screen. I was not able to start Windows. Thinking it would be a problem of S/W, I formatted.

    The problem persists and I can not load Windows XP.
    Can someone tell me what the problem with my laptop?

    Hello

    This sound like a hardware malfunction and I guess it could be something wrong with the graphics card or motherboard :(

    But the vertical lines appear on the external screen? If so, then it must be a matter of Council.
    In this case, you have a lot of possibilities. In my opinion, ask the guy to service for the control of the laptop. The technicians of the service in your country partner could run diagnostics tests and will give you more details about the failure.

    Good luck

  • Satellite Pro A210 - repeat vertical lines on the screen

    I hope someone can help me.

    I am a teacher and was bought by my school a Toshiba Satellite Pro A210 for me to do my school work and connect to a SMART board to teach with. Throughout its probably one of the best laptops I got through school. I got it two months.

    There is only one problem with it. Its developed a rather weird problem. Occasionally, the screen suddenly freezes, and the display will be replaced by thin, alternating vertical black and white lines. The only way to get rid of them is to turn off the laptop and restart it (particularly annoying when it happened in the middle of a lesson when I've been respected by an OFSTEd Inspector!)

    Technician computer school has no idea what is the cause. I was wondering if someone here might have some advice.

    Thanks in advance.

    I ve the same laptop but I didn t receive similar lines on the screen.
    What you could do is update the BIOS and the driver (if possible) display.

    If the same problem happens again, you must connect an external monitor to the laptop.

    Then check if the same lines appears on the external display. If so, then a problem of graphics card might be possible!

  • Blue vertical line on the screen of the Qosmio G20

    A few minutes ago, I was surfing the web and from nowhere share an apperead to the blue vertical line on the screen.
    A blue vertical line near the middle of the screen and crosses the screen all the up toward the bottom.

    If I'm looking at a white background, the line is undetectable, but if it is colored, it comes right thru.

    Please don't tell me they are dead... hoooo pixels... I am now, life away from any toshiba repair shop and I get a guarantee...
    I think that I bought 3 years ago. Need urgent help

    Hey Susana

    I wouldn't say it s a lack of dead pixel, but to me, it looks like a more serious problem.
    It looks like a malfunction of the graphics card. But to be sure, you should try to connect the external monitor to the computer and check if the same vertical line will appear on the second screen.

    If you're going to see the same line on the external monitor, then I assume that the question of the vertical blue line might be linked to the GPU fault.
    This could be the case value because the chip graphic card cannot be replaced. You need to replace the whole motherboard :(

    So, as you see it s not easy to solve this problem and I really recommend to contact a technician who has more experience with these laptop problems.

    Good luck

  • Match pattern IMAQ 4 to superimpose several lines 2

    Hello community OR,.

    I have a problem connecting to the match pattern to superimpose several lines 2.

    I want to track an object from a video webcam.

    In this help http://zone.ni.com/reference/en-XX/help/370281U-01/imaqvision/imaq_match_pattern_4/ it is said that the Matches (Pixels) (Bounding Box) must be connected to the superposition of several lines to the end of line Points. But I can't take the bounding box only. I tried the unbundling of the table 1 d of the clusters, but I can't do it.

    Any help is appreciated. I can post a picture of my code if requested.

    Thank you

    Marwan Sabry

    I'm sorry, it's an array of clusters.
    -Therefore, index 0 for the first game.
    -unbundling with name for encompassing and then pass it to overlay vi.

  • In Windows 7 we select several lines of data that are in a different location on the page (no continuous lines) through the mouse or keyboard and also can we copy all lines of these different at the same time to paste somewhere else in one fell swoop.

    > Now I'm unlable to select more number of lines that are not a sequence in a single page to copy the data rows and paste somewhere in one fell swoop.
    > Is this concept implemented in Windows 7. ?
    > Is there a provision (method) to select several lines that are not continuous across the keyboard or the mouse in windows 7?

    Byagaris,
    It depends on what program you are trying to copy and paste into.  You are able to select continuous, multiple lines, by using the Ctrl Key and clicking, or by highlighting the desired line.  For example, I held the Ctrl key and then, using the mouse, has highlighted several different phrases in the various paragraphs, and could then copy them.  This feature is available for several versions of windows.
    If you are not able to perform this action then post what happens when you try and what program you try it.
    Mike - Engineer Support Microsoft Answers
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • HP Officejet Pro L7590 all-in: HP officejet Pro L7590 prints 1/2 of the line of text on several lines of the document

    I received an email for the diagnosis of the printer and I was prompted to install the updated drivers and I did it and now when I print the test page, I get several lines of text that displays only the top or the bottom 1/2 letters across the page, I printed a self-test diagnostic Page and printed everything in pink , but it does not print 1/2 letters across the page as a test page, then I printed a page of print quality and it did the same as the test page and it does the same thing as the test page, then I tried calibrate spacing of thought which may fix the problem but does not , what can I do?

    Irven

    Hi mmcmret8,

    Thank you for your answer! It is possible that the print heads may need to be changed, at this point, I would recommend to you please call our hotline at the 800-474-6836. If you do not live in the United States / Canada region, please click the link below to get help from your region number. Language-country selector.

    Best regards!

  • Blue vertical line on the screen

    Hello

    After a day of use, I have a blue vertical line on the screen. Defective LCD screen? Tried to reapply the latest firmware, but that doesn't change anything. Other things to try before a sent an RMA?

    I dunno if Newegg "corresponds to" Amazon product replacement policy is defective products: Amazon will cover the shipping costs for the return (via a pre-paid return label he sends you) but also send a replacement free of charge.  You might want to check with Newegg, if your Clip has been purchased recently.

    Apart from Newegg, if you need to take advantage of the SanDisk warranty directly with her, SanDisk (at least in the United States) covers shipping as well as for the replacement that is sent back.

    http://www.SanDisk.com/about-SanDisk/contact-us?utm_source=contactus&utm_medium=hyperlink&utm_campai...

  • Multi-colored vertical lines on the screen until you restart

    I get multi-colored vertical lines on my screen and lose control of the mouse. Power off and restart eliminate the problem. Y at - it a permanent cure?

    Question seems closed. Lines no longer appear after you download a driver from the manufacturer of the monitor.

  • I asked before but everyone has discovered what causes vertical lines on the screen?

    I have vertical lines on my screen about 6 or 7 and his worst do. They go to various shades of pink, green and yellow. I asked if anyone knew the answer later when there was only 1, and even if other people had this problem no one knew the answer. Has anyone discovered yet because its getting so irritating, I think I need a new machine. Any suggestions gratefully received.

    Rupture of the membranes that make up the screen is what causes the problem.

    Rupture may be caused by indifferent manufacturing, overzealous pressure while cleaning and old age.

    Sometimes the graphics card can go wrong, but they will generally 'very bad', not just some annoying lines on the screen.

    In the end, you will have t get the screen replaced... :-)

Maybe you are looking for

  • Data from iTunes Genius

    I understand databases Apple Genius in iTunes, but what I don't understand is why he needs to update the old songs, that it is already updated countless times that she updates the new downloads of the song I've done?

  • Update of lion in El Capitan

    I'm under lion 10.5.7 should I move to El Capitan?  I heard that people have problems after the update.

  • If I bought Match iTunes, why Radio has disappeared?

    I bought iTunes game in large part because TI included ad free radio Radio is now gone from my computer iTunes and my iPhone. It's a glitch, affecting only me, or they have it decoupled iTunes game?

  • NOTICE of SUSPENSION: Update your microsoft windows

    I received an email from Microsoft [* address email is removed from the privacy *] saying "it has come to our attention that your Microsoft installation documents windows are obsolete. Each installation of Windows must be linked to a daily update e-m

  • WebEx: Window popup block showing who's speaking when the users speak

    Here's the scenario: I present to you a WebEx Conference of a large group of people live, as well as to people connected to virtually. When one of the virtual people start talking, a small window will appear in the upper right. This area becomes anno