Alignment of fields

I went around and around this issue and have not found anything definitive posted in this forum. I am trying to add a footer to my application. The footer consists of two LabelFields, aligned to the left of one and the other aligned right as so. However, no matter what I try, the best I can get is a layout as follows:

The footer is the entire width of the screen which is OK. The foot is a HorizontalFieldManager

and copyright and terms labels are themselves contained in their own VerticalFieldManager. The question that I have, as you can see above is that the terms field remains aligned in that's half of the screen. How can I get to be propped right?

Peter, thanks for the reply. I ended up using this library (which I think I found in one of your previous answers to someone who had a similar problem):

https://github.com/BlackBerry/samples-for-Java/tree/master/advanced%20UI/src/com/samples/Toolkit/UI/...

Specifically, I used the JustifiedHorizontalFieldManager.java class.

Tags: BlackBerry Developers

Similar Questions

  • How to align form fields in 4.2.6

    Hello

    I use apex 4.2.6.  Wanted to know how to align the fields according to my condition.  For example, 3 fields through and again a few 4 fields in the row.  I use 'Checkerboard'-> 'New Start line' attributes.  But this seems a little dirty.  Is there another way?

    I created an example on oracle for the EMP table.  If someone can clarify.

    (workspace: test_ws_anand user: anandgp password: cable123)

    img 2.png

    Thank you

    -Anand

    anand_gp wrote:

    I use apex 4.2.6.  Wanted to know how to align the fields according to my condition.  For example, 3 fields through and again a few 4 fields in the row.  I use 'Checkerboard'-> 'New Start line' attributes.  But this seems a little dirty.  Is there another way?

    I created an example on oracle for the EMP table.  If someone can clarify.

    (workspace: test_ws_anand user: anandgp password: cable123)

    Your layout grid settings were:

    Sequence Name of the element New line New field
    10 P4_EMPNO Yes Yes
    20 P4_ENAME NO. NO.
    30 P4_JOB NO. NO.
    40 P4_MGR NO. NO.
    50 P4_HIREDATE Yes Yes
    60 P4_SAL NO. NO.
    70 P4_COMM NO. NO.
    80 P4_DEPTNO NO. NO.

    This means that all elements on each line were placed in the same cell in the grid as the first:

    I created a copy of the application and changed the settings of the grid so that each element is in a cell of the grid:

    Sequence Name of the element New line New field
    10 P4_EMPNO Yes Yes
    20 P4_ENAME NO. Yes
    30 P4_JOB NO. Yes
    40 P4_MGR NO. Yes
    50 P4_HIREDATE Yes Yes
    60 P4_SAL NO. Yes
    70 P4_COMM NO. Yes
    80 P4_DEPTNO NO. Yes

    What gives the layout desired by 3 points in the first row and 4 in the second:

    You should consult the documentation on how question attributes affect layout. Note that the best way to control the layout is to change the properties of the layout of all the elements at the same time using the change all button on the page view component. The option Show Grid in the developer toolbar is also useful in showing the layout of the items in the grid.

  • Alignment of fields horizontally in the component af:query

    Hi friends,
    I'm developing a search box using the criteria named my VO dragging. This has created an af:query element in the search box. However, the fields are displayed in rows in the search box. I want to align those fields so that all fields are displayed in a single line. also how can I set the width of the field.

    Any ideas or advice how to do this.

    Thanks in advance

    Published by: user9197772 on May 20, 2013 03:58

    To do this, you set the maxcolmns and the rows of the af property: query as
    ... lines argument maxColumns = '1' = '10 '...

    MaxColumns argument must equal the number of fields you want to see in a single line.

    The length of the fields is controlled by the attribute displaywidth property in the VO. Here, you can display the width on the Interface user-instructions of the attribute tab.

    Timo

  • Alignment of fields ARGH!

    Could someone please tell me the reference of the Grail on work how to align?

    I have... How do these things align right?

    HorizontalFieldManager fmLine2 = new HorizontalFieldManager( HorizontalFieldManager.NO_VERTICAL_SCROLL | HorizontalFieldManager.USE_ALL_WIDTH );
    
    displayLapTitle    = new LCDTitleField("Lap ", LabelField.FIELD_RIGHT);  displayLap         = new LCDField(""+0, LabelField.FIELD_RIGHT);    displayTimer2Title = new LCDTitleField("  ", LabelField.FIELD_RIGHT);   displayTimer2      = new LCDField(lcdFormat(0), LabelField.FIELD_RIGHT);
    
    fmLine2.add(displayLapTitle);
    fmLine2.add(displayLap);
    fmLine2.add(displayTimer2Title);
    fmLine2.add(displayTimer2);
    
    add(fmLine2);
    

    Here are a few rules:

    • HorizontalFieldManager respects the vertical alignment styles, but does not take into account the horizontal alignment styles and sets fields on the left to the right.
    • VerticalFieldManager respects horizontal alignmnet styles, but does not take into account the vertical alignment styles and sets up-down areas.

    So to align your four fields on the right, you can do something like this:

    VerticalFieldManager vfm = new VerticalFieldManager(USE_ALL_WIDTH);
    HorizontalFieldManager fmLine2 = new HorizontalFieldManager(FIELD_RIGHT);
    
    displayLapTitle    = new LCDTitleField("Lap ");
    displayLap         = new LCDField(""+0);
    displayTimer2Title = new LCDTitleField("  ");
    displayTimer2      = new LCDField(lcdFormat(0));
    
    fmLine2.add(displayLapTitle);
    fmLine2.add(displayLap);
    fmLine2.add(displayTimer2Title);
    fmLine2.add(displayTimer2);
    
    vfm.add(fmLine2);
    add(vfm);
    
  • Field layout - splitting of alignment of fields

    Hello

    I would like to put four areas on a single line. The first field (a LabelField), I would like to align itself with the left side of the screen. The other three areas, I would like to align itself with the right side of the screen. What is the best way to achieve this?

    I put them all in a HorizontalFieldManager. I put the HorizontalFieldManger to Manager.USE_ALL_WIDTH. I put the LabelField for Field.FIELD_RIGHT and the other three fields to Field.FIELD_RIGHT. However, everything is left-aligned.

    Thank you

    I gave a few code snip: its created for button

    First go and take it and change it to your target.

    class MyHorizontalFieldManager extends HorizontalFieldManager
    {

    private ButtonField leftButton;
    private ButtonField rightButton;

    public MyHorizontalFieldManager() {}

    Super (USE_ALL_WIDTH);

    ButtonField leftButton = new ButtonField ("Left");
    setLeftButton (leftButton);
    Add (leftButton);

    ButtonField rightButton = new ButtonField ("Right");
    setRightButton (rightButton);
    Add (rightButton);
    }

    protected void sublayout (int maxWidth, maxHeight int)
    {

    Super.sublayout (maxWidth, maxHeight);

    width int = getWidth();

    ButtonField rightButton = getRightButton();
    If (rightButton! = null & is equal to (rightButton.getManager ())) {}

    int x = width - rightButton.getWidth ();
    int y = 0;
    setPositionChild (rightButton, x, y);
    }
    }

    getLeftButton() private ButtonField
    {

    return leftButton;
    }

    Private Sub setLeftButton (ButtonField leftButton)
    {

    this.leftButton = leftButton;
    }

    getRightButton() private ButtonField
    {

    rightButton return;
    }

    Private Sub setRightButton (ButtonField rightButton)
    {

    this.rightButton = rightButton;
    }
    }

  • Report - form how to align the fields above the other

    Hello

    I have the report formatting I want to have a field with guest left this one per line. I wish all the fields under one of the other goes down of left page.

    I tried all variants with layout-> alignment, but can not get the desired result. Description in the manual seems simple, but don't know what I'm doing wrong.

    I wish only one record per page. Super simple desired attached output.

    Thank you

    Yes, in the layout of the document. assistants can make the initial layout or you can do it manually, but even if you use the assistants you are always free to change the layout.

    When moving things from the presentation, you want to be careful about the flex and limit parameters. they are controlled by the buttons at the top where the ToolTips are "confine on ' or 'Confine offshore' and ' Flex on ' and «off Flex»

    If flex is on, many things may move when you move an object. Turn it off to see the difference (it is enabled by default).

    Borders is also important. You do not want to move items out of the box where it belongs unless you know what you're doing. By default, borders on.

    Good bye.

  • Align the fields of HorizontalFieldManager

    vfm = new VerticalFieldManager(VerticalFieldManager.USE_ALL_WIDTH);
    hfm = new HorizontalFieldManager();
    Date now = new Date();
    SimpleDateFormat sdf = (SimpleDateFormat) DateFormat.getInstance(DateFormat.TIME_LONG);
    String time = sdf.format(now);
    hfm.add(new LabelField(time));
    labelField1 = new LabelField("1", LabelField.FIELD_HCENTER);
    labelField2 = new LabelField("2", LabelField.FIELD_RIGHT);
    vfm.add(labelField1);
    vfm.add(labelField2);vfm.setBackground(BackgroundFactory.createSolidBackground(Color.RED));
    hfm.add(vfm);
    add(hfm);
    hfm.setBackground(BackgroundFactory.createSolidBackground(Color.GREEN));
    

    Please take a look at this code. I expect to do the following: add time to the left of the horizontal field Manager, and then add a field in the center of it and in the right part. The first two tasks succeeded. But what is the problem with the third label, i.e. with "2"? Why would she be placed in the next line?

    Please tell me what I'm doing wrong...

    hfm = new HorizontalFieldManager(USE_ALL_WIDTH)
            {
                protected void sublayout(int maxWidth, int maxHeight)
                {
                    super.sublayout(maxWidth, maxHeight);
                    setPositionChild(this.getField(0),0,0);
                    setPositionChild(this.getField(1), (this.getWidth() - (labelField1.getWidth()))/2, 0);
                    setPositionChild(this.getField(2), (this.getWidth() - labelField2.getWidth()), 0);
                }
            };
            Date now = new Date();
            SimpleDateFormat sdf = (SimpleDateFormat) DateFormat.getInstance(DateFormat.TIME_LONG);
            String time = sdf.format(now);
            LabelField timeLabelField = new LabelField(time);
            hfm.add(timeLabelField);
            labelField1 = new LabelField("1", LabelField.FIELD_HCENTER);
            labelField2 = new LabelField("2", LabelField.FIELD_RIGHT);
            hfm.add(labelField1);
            hfm.add(labelField2);
            hfm.setBackground(BackgroundFactory.createSolidBackground(Color.RED));
            add(hfm);
            timeLabelField.setBackground(BackgroundFactory.createSolidBackground(Color.GREEN));
    

    Use this code, you will get the desired result.

  • How to vertically align text field?

    I drop a couple of text field on the form, but there is no way to adjust the texts so that it starts from the top to the bottom instead of in the middle of the text box. Any help is very appreciated.

    Multiline value.

  • Alignment of fields of VerticalFieldManager


    Thanks, but I opted to use the HorizontalFieldManager... why even bother using VerticalFieldManager... He already has the word Vertical in the beginning lol.

    Anyway, thanks again for the reply!

  • Properly aligning the field button in the status bar?

    Hello

    I've set up a status as shown in the picture below scroll bar.

    The icons that were placed between the left and right arrows are not uniform in all devices. I want their position to decide taking into account the width of the screen of the device.

    Can anyone suggest how it should be done? I used GridFieldManager to place this icons.

    Can anyone suggest me something?

    We hope to get an answer soon.

    Hello

    I managed to solve my problem by using TableLayoutManager.

  • Animated GIF field loses alignment

    Hello

    I have a background image set to a vertical Manager...

    n then I want to align a field led to a certain position on the screen... I tried to add the gif animated image to a manager of vertical and the substitution of the layout of this Manager position does not work too...

    Hey thanks... juice I get it working...

    Just replace the sublayout of the main Manager method and setPositionChild...

  • Frustration of the alignment of text

    It seems impossible to align easily all the text in a LabelField.

    I add two fields to a simple HFM, and the left one is left aligned just like I want, but I want the 2nd right-aligned field.

    So I could better see what was going on, I put some color in an object, and it's the inner class of right field:

       private static class MovesField extends LabelField {
            MovesField( String n ) {
                super( n, LabelField.FIELD_RIGHT );
            }
    
            public int getPreferredWidth() {
                return 60;
            }
    
            public void paint( Graphics g ) {
                g.setColor( Color.DARKGOLDENROD );
                g.fillRect( 0, 0, this.getWidth( ), this.getHeight( ) );
                g.setColor( Color.BLACK );
                super.paint( g );
            }
        }
    

    RED is the first LabelField and goldenrod, the second I want to be propped right.  The text in the field is only 2-3 charaters long, so 60 pixels works very well, but the text is left aligned!

    It's really annoying.  The API says that it is a valid style, then why my text does not match?

    You can override sublayout in the HFM and right align the field manually. HFM width needs to be greater than the sum, and then the two fields to be worth it.

    protected void sublayout( int width, int height ) {
    
        super.sublayout( width, height );
    
        width = getWidth();
        height = getHeight();
    
        Field field = getSomeField();
        if (field != null && equals(field.getManager())) {
    
            int x = width - field.getWidth();
            int y = (int)(height * 0.50);
            setPositionChild( field, x, y );
        }
    }
    
  • Lining up a field to the w.r.t. Center another field

    Hey,.

    I'm trying to align a field with a location X and Y to the center of any other area which I can get its X and Y also... I remember there was only an equation for this, but I forgot what it was...

    I want to do the following:

    _____

    |   A    |

    |____ |

    __________

    |        B         |

    -----------------

    In fact, A.x = (Display.getWidth () - A.width) / 2 will be more to the point. (B.width - A.width) / 2 corresponds to the offset of A against B - but you needn't A.x compared to the left edge of the screen, you?

    And, of course, you need to ask a and B prior to use their width and height - so of your Manager sublayout should have two calls layoutChild , followed by two calls to setPositionChild . But I suspect you already know .

  • Once again: the Horizontal alignment in HFM

    Hello

    I want to align a field of custom in a Horizontal Manager button

    Definition of the HFM

    final HorizontalFieldManager _navigation = new HorizontalFieldManager(HorizontalFieldManager.NO_VERTICAL_SCROLL | HorizontalFieldManager.FIELD_VCENTER | Field.USE_ALL_WIDTH)
    {
         protected void paint(Graphics graphics)
         {
             graphics.setGlobalAlpha(100);
    
             int[] xInds = new int[]{0, getExtent().width, getExtent().width, 0};
             int[] yInds = new int[]{0, 0, getExtent().height, getExtent().height};
             final int[] cols = new int[]{Color.WHITE, Color.WHITE, color_computacenter_light_blue, color_computacenter_light_blue};
    
             graphics.drawShadedFilledPath(xInds, yInds, null, cols, null);
             super.paint(graphics);
         }
         protected void sublayout(int maxWidth, int maxHeight)
            {
                super.sublayout(maxWidth, maxHeight);
                setExtent(maxWidth, navigation_vertical_manager_height);
            }
    };
    

    Custom field (partial)

    public class NavigationButton extends Field
    {
            private String label;
            Bitmap img;
            int horizontalPadding = 4;
            int verticalPadding = 10;
            static int height;
            static int weight;
            ToolTip _tooltip;
    
            public NavigationButton(String name, Bitmap img)
            {
                label = name;
                this.img = img;
                this.height = img.getHeight() + 4;
                this.weight = img.getWidth()  + 2;
            }
    
            public NavigationButton(String name, Bitmap img, long style)
            {
                super(style);
                label = name;
                this.img = img;
                this.height = img.getHeight() + 4;
                this.weight = img.getWidth()  + 2;
            }
    
            protected void layout(int maxWidth, int maxHeight)
            {
                setExtent(maxWidth, maxHeight);
                // setExtent(Math.min(weight, maxWidth), Math.min(height, maxHeight));
            }
    

    [...]

    Any ideas what I am doing wrong?

    Thank you!

    Thank you! The grid layout manager works very well, as you can see in my new assignment * g

  • Oracle of the MAF: Incorrect alignment in the user interface

    Currently working on the MAF to design an application. but I am unable to align the fields in perfect order... I described the width of each field to be the same. but still do not get the same alignment for all fields when folding of the emulator. Please suggest on this issue. It will be very useful. Thanks in advance

    I'm not sure what you aim to achieve specifically but in your example, the fields are not actually inside the panelGroupLayout component - is this intentional?

    Also - what using an amx:panelFormLayout to surround the fields?

    autoCapitalize = 'auto' AutoCorrect 'auto' inlineStyle = = "" max-width: 20 cm; "/ >"

Maybe you are looking for