LabelField text position

Hi, I have created fat labelfields by adding some padding on them and have managed to align the text in the Middle through DrawStyle.HCENTER.

I wonder how I can make centered vertically as VCENTER does nothing.

I can think of a way to achieve what I want - by adding the margin calculated upwards, but this seems to be a lot more work.

Any help will be appreciated!

I solved the problem by positioning the text manually (replacing the graphics).

Thank you very much for your help!

Tags: BlackBerry Developers

Similar Questions

  • more UI questions. Custom LabelField and ListField text positioning

    Hello

    I have two questions.

    1. I implement a LabelField, and I want to be the width of the screen and the text to be in the middle of its width. I am implemented with these bits of style: DrawStyle.HCENTER | DrawStyle.VCENTER | Field.FOCUSABLE | Field.FIELD_HCENTER. Then I overload layout() with this:

    public void layout(int width, int height) {
                    super.layout(width, height);
                    setExtent(Display.getWidth(), this.getPreferredHeight());
                }
    

    The result is that the width of the field extends across the width of the screen, but the text is left-aligned. What I am doing wrong?

    2. I've implemented a ListField personalized with a custom drawListRow(). For some reason, the color of the text in the highlighted line remains black. I don't know what I did wrong. I was expecting that there the default highlight a behavior, which is thoroughly blue, white text.

    Thank you

            public int moveFocus(int amount, int status, int time) {
                _listField.invalidate(getSelectedIndex());
                return super.moveFocus(amount,status,time);
            }
    
            //Invoked when this field receives the focus.
            public void onFocus(int direction) {
                super.onFocus(direction);
            }
    
            //Invoked when a field loses the focus.
            public void onUnfocus() {
                super.onUnfocus();
                _listField.invalidate(getSelectedIndex());
            }
    

    In my ListFields sexy do Paint (usually different color according to the status background), I use a substituted ListField that invalidates whenever he thinks he needs to, the idea being that it forces the line to be redrawn.

    I'm not confident in them, but they do not seem to work.  It's code that I created when I started it first, I didn't need to change so I don't have, but I'd be very confident that it is not optimal.

    OK, so you know this code comes with no warranty.

    I have replaced three routines as follows:

  • Shadow text positioning

    Why is so hard to accurately position a drop shadow on text. It is difficult to get the shadow exactly where I want to. It is easier to position a shadow in Microsoft Word it is in Fireworks. Why don't you simply use the arrow keys to go to the top, bottom, left, right. This would give you the accuracy you need. Maybe I'm missing something. Does anyone know of an easier method for one use other than that stupid degree circle.

    You can use the arrow keys to move the shadow if yiu create it as a separate image object. Clone of the text, add a Gaussian blur. Move behind the original yiour text. Move it where you want. If you want to use the built in filter drop shadow, and then type the coordinates in rather than using the dial and the cursor.

  • My text Position moves according to the browser I use

    I'll have a bit of trouble getting my text remains put in different browsers. For the text on the buttons on my left, I've been putting text in an APdiv and Center the text on the button. It stays put in IE, but the APdiv moves to the top of the button (table cell) in Mozilla and downwards (table cell) button in Safari.

    I tried to use the CSS rule definition window to place the APdiv in an absolute position 'top' and I will still have the
    the same problem.

    I read the article on absolute positioning on Dreamweaver CS3 The Missing Manual but nothing I read really helped me and as I said, I already tried the absolute positioning.

    I'm new at this and the site that I'm getting is for my last class and I'm really trying to do things. I'm not good with basic coding, so, if your useful response includes code, please be very specific about the places where to place in it section of the code of the page.

    I have not yet added my site, but I have a picture of the homepage take my place. You can see here. The buttons are placed images flown in a table and the text I use in the APdiv in addition to this is not the text that appears on the buttons (had problems and decided to go simple with DWs fonts - used the set Geneva, Arial, Helvetica, without serif).

    I'm working on a PC running Windows XP Media ed. w / SP2 if that makes a difference. And I'm in DW CS3.

    Please help ASAP - the site is due Wednesday 12/12.

    Thanks in advance.

    Hello

    The reason is the following:


     


     


     


    You use

    Tags to control spacing in your layout.
    You have the table that contains your 3 spaced paragraphs of rollover images
    of the top table.
    The problem is the paragraphs have different default margins in different
    browsers. That's why you have the alignment problem.
    Normally, you would use CSS to give all the

    Tags the same margin to give
    lines of text the same spacing cross browser.
    However, which won't help here because users have different text sizes
    their browsers. Different text sizes: different line height.
    In text view browsers set to "big text" your table with images
    will be a lot of space between it and the upper table. In browsers with
    small text, the table will be so much near the top table.
    Meanwhile, your PA divs will remain in the same place on the page.
    The text will be only line upo worm images for people who have their
    text exactly the same value as your size.
    That's why you shouldn't use

    Tags to control the spacing between the objects when graphically the
    objects must be in a specific location in the layout.

    The solution is to get rid of the

    Tags and CSS to give the table use
    with the reversal of the pictures in a higher margin.

    First of all, get rid of the

    tags and give a CSS class to the table below them.
    Change this:


     


     


     


    To do this:



    Class = "leftnav" >

    Then, set the class in your CSS. You can add it to the end, just after
    you are a: active link style:

    Change this:

    a: active {}
    text-decoration: none;
    }
    -->

    To do this:

    a: active {}
    text-decoration: none;
    }
    {.leftnav}
    margin-top: 150px;
    }
    -->

    Adjust the desired margin to align the table with images with your
    Divs PA.

    I hope this has helped.

    Take care
    Tim

  • Windows 7 Text positioning errorswhen typing

    Installed 32-bit Windows 7 to replace XP. New problem after installation, the text cursor not always a right place all keys press but jumps back and inserts new text in the previous text typed. By installing the program free "Touchfreeze' has reduced the frequency of errors, but it is still a problem. Keyboard is a standard PS/2 type. Suspect a keyboard driver problem (bug). Have the latest version of the driver installed for Pavilion dv8025EA.

    Driver version: 6.17601.17514

    Driver files: C:\windows\system32\DRIVERS\i8042prt.sys file version6.1.7600.16385

    C:\windows\system32\DRIVERS\kbdclass.sys version6.1.7601.17514 software Micrsoft signed file.

    Think I need a spare keyboard driver to clear this bug? It seems to be an old problem with Windows 7, which in 2010, but I can't seem to find a clear solution in the forums.

    I finally solved this problem (atlast) of the keyboard cursor back jump bad placing text between previous texts.

    The problem is certainly due to accidentally catch me the pavement as I type.

    My solution is a small free program called Touch Pad blocker. V.2.9.0.59 (www.touchpad-blocker.com)

    I t disconnect the trackpad once typing begins. I can set the blocking time to adapt my typing speed. I use 2 seconds...

    Keys fn + f5 toggle the power switch program.

    Deytails system: laptop HP dv8025EA Inc. standard Synaptics trackpad.

    Windows 7 Home Premium by Dell computers

    Touchpad Blocker as above.

    Cheers, Adjer.

  • Hang the text position germane: can it be done?

    We use text blocks which occupy only half the width of the page.

    Sometimes, I have a high level course that breaks on a second line. I prefer to keep the text on one line and get him out of the block of text (either to the right or the left, according to the odd/even character of the page).

    I know that I can cut and paste the title in a new block of text and apply space above the paragraph next to the body, but:

    • It's messy
    • This breaks the sequence between the images etc.

    Is there a way I can put one single paragraph to 'break' the border of the text block?

    Thank you

    Then try this: convert the paragraph of title to a single table cell. That the cell wide enough so that the text on a single line - cells are allowed to stay outside (even though no one knows why)-, but take care of is not to make any longer than necessary. Then, select the paragraph that this table is 'in' and set its justification "Away from Thorn" or "toward the spine.

  • Text positioning

    I would like to create a block of text on a white page which is centered horizontally and vertically, regardless of the size of the screen of someone or a browser. Is it possible to do in Contribute?

    Thank you! Exactly what I was looking for.

  • FLF text position

    I am loading some product names in a textfield and I got some buttons with some of these names in product thereon. When the user clicks a button on product, how the textfield scroll automatically and display this particular element in the measure are specified?

    You can use the property of textfields scroll to scroll:

    yourTextField.scroll = 10;  for example

    or

    yourTextField.scroll = yourTextField.maxscroll;

  • Position control text string bug

    Hello again all you posters useful forum!

    I have a strange bug for a control of the chain.  A sort of property has been set which causes the text it displays justified right as usual until what you press a button in the control.  Then the text jumps around 3 characters to the left.  By clicking on the right side of the new end text positions the cursor at the end of the text.  If I save the VI, the text jumps to the right.  Weirder yet, if I just hide the front panel of the VI with another window, when I discovered the text is on the right side once again.

    When I click in the text box with the mouse to position the cursor, the text does not move, but the cursor will only insert inbetween where the characters go when they jump to the left, where they are currently.  This highlighted the same behavior (see screenshot where I double-clicked in the control to highlight all of the text).

    I copy / pasted this control channel in a new VI with no logic, and it behaves in the same way.  So I guess it's a kind of property that I put at some point, but I can't understand it so I can stop doing it in the future (which is also the reason why I'm not only replace my order with another control of the chain and move - I don't want a new to get damaged in the same way).  I have attached the new VI for your reference.

    Control is updated the value that I type, and in my original VI (which I can't post, unfortunately), I have two cases of the event who get its updates of the value.  We seek a change in the value of this control, check if it is more than 12 characters and if yes what bands more than 12 characters and then it passes through the VI uppercase in and assigns the resulting string in the control.  The other looks for a value change parent of the control cluster, then takes the control reference that result and goes to a VI record KeyFocus and TextSelection property values, defines "BOLD", the blue police false KeyFocus, changes, then sets the KeyFocus and TextSelection values (in that order).   I have to take off bold KeyFocus, I discovered.

    Any suggestions as to what may be the cause of this would be appreciated.  Thank you!

    -Joe

    I bet that the text is right-justified.  Select the text, go to the menu drop-down font, select the option justify-> left and see what happens.

    Edit: interesting.  Out, tried changing the left justification and then right again seemed to fix it.

  • Problem of position relative text object

    Hello

    I have a problem by specifying the relative position of the object using DIAdem scripts.

    I try to use the RelPosLst variable to set the position of the text relative to the 'right '. However, when I run the script, I always get "Center" as the relative text position. The following code example:

    Call GraphObjNew ("FreeText", "Text3")

    Call GraphObjOpen ("Text3")

    TxtPosX = 14.7

    TxtPosY = 57

    TxtBold = True

    TxtTxt = "Site:"& Site.

    TxtFont = "Arial".

    TxtSize = 4

    RelPosLst = 'Right '.

    Call GraphObjClose ("Text3")

    I'm doing something wrong?

    Thank you

    Egor

    Hi Egor,

    the RelPosLst variable is only the variable in the list of positions, you must use the TxtRelPos variable in your code.

    Tip: If you want to get all the variables dialog box, open it and press on "Strg + a". With this, you copy all (scriptable) variables of the dialog box to the Clipboard and you can paste it in your VBScript. It's much easier to find the help file.

    In the code:

    Call GraphObjNew ("FreeText", "Text3")
    Call GraphObjOpen ("Text3")
    TxtPosX = 14.7
    TxtPosY = 57
    TxtBold = True
    TxtTxt = "Site:"& Site.
    TxtFont = "Arial".
    TxtSize = 4
    TxtRelPos = 'right '.
    Call GraphObjClose ("Text3")
    Call PicUpdate

    Sven cordially

  • Why the text in the fields of the contact form changes position in the different States?

    Dear Muse Maniacs.

    I used the SIMPLE CONTACT widget. In design mode in the Muse of all States to look (void, no vacuum, orientation,...) very well. After the export of local browser, BC oder my hosted URL, the text position jump between these States.

    Site URL:

    http://WOL-v10.BusinessCatalyst.com/Kontakt.html

    Feel free to watch this video screencapture to check my settings in my file of Muse and compare it to what happens in the browser:

    Adobe Creative Cloud

    Definition of Muse:

    Bildschirmfoto 2016-04-09 um 21.43.28.png

    Preview in the browser:

    Bildschirmfoto 2016-04-09 um 21.05.20.png

    Bildschirmfoto 2016-04-09 um 21.05.54.png

    Thank you very much for your help.

    Best regards, Moritz

    Thanks a lot for your comments, Mylenium.

    By "adjust text settings", you mean this way to solve?

  • Positioning of text in the block

    Hello

    I am wanting to position text in a box/block, here are the items in the list that I used as navigation buttons.

    I set the size of the box and that you have selected 'center' for text positioning, this positions the text in the Center horizontally ok.

    I would like to know how to position the text to the Center verticially so?

    Thank you very much

    Mark

    Markcronin123 wrote:

    Hello

    I am wanting to position text in a box/block, here are the items in the list that I used as navigation buttons.

    I set the size of the box and that you have selected 'center' for text positioning, this positions the text in the Center horizontally ok.

    I would like to know how to position the text to the Center verticially so?

    Thank you very much

    Mark

    Short answer is that if you are using a

    You can do this with reliability. For now, css has no property that will allow you to center the text vertically in a container.

    You can center a single line of text using the css line-height property, but you must set the area a specific height, which is not a good solution.

    You can use padding-top: XXpx; to set the text for the top of the box but it will never vertically centered in the browser for everyone. There is a css thing oem simply not do again. But the advantages outweigh the disadvantages.

  • FieldListener... LabelField

    I have a screen with a 'labelfield' initially set to "0000", .i have stated this labelfield in "public class ContactsManagerScreen extends screen '... I have a FiledListener class inside the class of ContactsManagerScreen,... now, this listener responds to a click of a button... When control is handed to this FieldListener... via clicking on a button... I want the text of the LabelField to change the "0000" to "1234"... can anyone please help me on how to reach the LabelField text within the FieldListener class.

    I finally thought to her, I had to extend my class in the FieldListener and then implement FieldChangeListener... * all smiles *.

  • How to focus LabelField programmable aid?

    Hi guys.

    I'm trying LabelField programmable way to use the accent.

    My share of coding:

    LabelField lbl = new LabelField("Text", LabelField.FOCUSABLE);
    mainScreen.add(lbl);
    lbl.setFosus();
    

    But this code does not work.

    When push the screen, this field is not well centered. Instead of him, first field focus concentrates.

    What I am doing wrong?

    Thanks in advance.

    crush onDisplay and focus the field here. You may need to use invokelater (for delay)

  • How do you reveal text when it crosses a line?

    I created a video with text that is revealed when he crossed a line in the center of the image. I was with initially just shape layers to 'block' on the side of the line where I wanted the hidden text, and then animate the text on the line, but it became embarrassing when I needed reverse the sense of the text and have it changed as it passes through back again.

    How do you solve this problem? I need to have the text cross back across the line and change each time.

    The best way to proceed is to use a shape layer or solid as a matte. Here's how to set up a composition where the text moved up and down and changed as he passed a line in the middle.

    1. Text Position Null
    2. Line
    3. Follow to half mast top of the screen
    4. Text that will appear at the bottom of the screen
    5. Follow mast to the bottom of the screen
    6. Test that will appear at the top of the screen

    To avoid having to create an extra pair of road to the mast and text layers, you can keyframe the source text and compensate for changes when each text layer were hidden. Parental text to null layers would that move you the two layers of text with synchronized without having to copy the keyframes or work on expressions. You then just change time in the source text so the words change when the layers are hidden. It should look like this:

Maybe you are looking for