Issue by setting the alignment

Hello

I'm dividing the bottom bar by using the following code, the bottom bar has given as img1 string img2. img2, the issue I'm facing is if the chain is small the img2 and img3 is moved to the left directions based on the length of string. What is the problem below

HorizontalFieldManager horizontalFieldManager = new HorizontalFieldManager)
FIELD_BOTTOM | Manager.USE_ALL_WIDTH) {}
{} public void paint (Graphics graphics)
graphics.setBackgroundColor (0x316AC5);
Graphics.Clear;
Super.Paint (Graphics);
}
};
FadeBitmap bitmap = Bitmap
.getBitmapResource ("icon_tz_faded_316AC5_35x39.png");
ClockBitmap bitmap = Bitmap
.getBitmapResource ("icon_date_picker_white_316AC5_35x39.png");
TzBitmap bitmap = Bitmap
.getBitmapResource ("icon_tz_white_316AC5_35x39.png");

ImageButtonField final unfocus = new ImageButtonField("",)
Field.FOCUSABLE | FIELD_LEFT, "icon_tz_faded_316AC5_35x39.png."
"icon_tz_faded_316AC5_35x39.png", 0xFFFFFF);

final ImageButtonField bitmapField = new ImageButtonField("",)
Field.FOCUSABLE | ImageButtonField.FIELD_RIGHT,
"icon_date_picker_white_316AC5_35x39.png,"
"icon_date_picker_selected_35x39.png", 0xFFFFFF);

final ImageButtonField bitmapField1 = new ImageButtonField("",)
Field.FOCUSABLE | ImageButtonField.FIELD_RIGHT,
"icon_tz_white_316AC5_35x39.png", "icon_tz_selected_35x39.png."
0xFFFFFF);

margin = ((Display.getWidth () - (fadeBitmap.getWidth () int
+ clockBitmap.getWidth () + tzBitmap.getWidth () + timezoneTitle
(((. getWidth())) / 4);

unfocus.setMargin (0, 3, 0, 0);
timezoneTitle.setMargin (0, 130, 0, 0);
bitmapField.setMargin (0, 15, 0, 0);
bitmapField1.setMargin (0, 0, 0, 0);

horizontalFieldManager.add (unfocus);
horizontalFieldManager.add (timezoneTitle);
horizontalFieldManager.add (bitmapField);
horizontalFieldManager.add (bitmapField1);

this.setStatus (horizontalFieldManager);

Edit - I noticed you wereonly questions about the full blue bar. This is because the HorizontalFieldManagers will not take the space they need in the absence of additional style flags. You want to paint the background of the SeparatedFieldManager, since it is the thing that occupies the entire width. First response continues below...

This is the code that produces the following output for me. It is the class of the entire screen in my test project... If your output is different, this is probably your ImageButtonField class as this is all the code that I did not. I replaced it with a simple ButtonField.

public final class MyScreen extends MainScreen
{
    /**
     * Creates a new MyScreen object
     */
    public MyScreen()
    {
        // Set the displayed title of the screen
        setTitle("MyTitle");

        HorizontalFieldManager horizontalFieldManager = new HorizontalFieldManager() {
            public void paint(Graphics graphics) {
            graphics.setBackgroundColor(0x316AC5);
            graphics.clear();
            super.paint(graphics);
            }
            };
            HorizontalFieldManager horizontalFieldManager1= new HorizontalFieldManager() {
            public void paint(Graphics graphics) {
            graphics.setBackgroundColor(0x316AC5);
            graphics.clear();
            super.paint(graphics);
            }
            };

            Bitmap fadeBitmap = Bitmap
            .getBitmapResource("icon_tz_faded_316AC5_35x39.png");
            Bitmap clockBitmap = Bitmap
            .getBitmapResource("icon_date_picker_white_316AC5_35x39.png");
            Bitmap tzBitmap = Bitmap
            .getBitmapResource("icon_tz_white_316AC5_35x39.png");

            final ButtonField unfocus = new ButtonField("button1",
            Field.FOCUSABLE | FIELD_LEFT);

            final ButtonField bitmapField = new ButtonField("button2",
            Field.FOCUSABLE | ButtonField.FIELD_RIGHT);

            final ButtonField bitmapField1 = new ButtonField("button3",
            Field.FOCUSABLE | ButtonField.FIELD_RIGHT);

            horizontalFieldManager.add(unfocus);
            horizontalFieldManager.add(new LabelField("testTitle"));
            horizontalFieldManager1.add(bitmapField);
            horizontalFieldManager1.add(bitmapField1);
            SeparatedFieldManager jfm=new SeparatedFieldManager(horizontalFieldManager, horizontalFieldManager1);

                    VerticalFieldManager test = new VerticalFieldManager();

            add(jfm);
    }

    public class SeparatedFieldManager extends HorizontalFieldManager
    {
        private Field leftField;
        private Field rightField;

        public SeparatedFieldManager( Field lField, Field rField )
        {
            super( USE_ALL_WIDTH );

            leftField = lField;
            add( leftField );

            rightField = rField;
            add( rightField );
        }

        protected void sublayout( int maxWidth, int maxHeight )
        {
            super.sublayout( maxWidth, maxHeight );

            int width = getWidth();

            if (rightField != null && equals( rightField.getManager() ))
            {
                int x = width - rightField.getWidth();
                int y = 0;
                setPositionChild( rightField, x, y );
            }
        }

        public void paint(Graphics graphics) {
            graphics.setBackgroundColor(0x316AC5);
            graphics.clear();
            super.paint(graphics);
            }
    }
}

Tags: BlackBerry Developers

Similar Questions

  • How to set the alignment of the centre on TextField?

    Hi guys.

    I have not found how to set the alignment of the centre on TextField?

    Do you know how to set the alignment of the centre on TextField?

    Please share your knowledge.

    Thank you.

    Hello

    Hope this will help you

    Import net.rim.device.api.ui.component.BasicEditField;

    class CustomTextField extends BasicEditField {}
    {CustomTextField()}
    Super(BasicEditField.FIELD_HCENTER |) BasicEditField.FIELD_VCENTER);
    }
       
    public void layout (int width, int height) {}
    Super.Layout (getPreferredWidth (), getPreferredHeight ());
    setExtent (getPreferredWidth (), getPreferredHeight ());
    }
       
       
       
    public int getPreferredHeight() {}
    System.out.println("---");
    beginning 50;
    }
       
    public int getPreferredWidth() {}
    System.out.println("###");
    Back to 120;
    }
       
    }

    Now in your class that extends the screen or full screen add this class object.

  • How to set the alignment of the right button on the toolbar

    Hello

    I place a text button and exit on the toolbar

    Capture.JPG

    I want to set the alignment of the button (Logout) right and output text (welcome weblogic) remain the same as it original position (Left). I have this rhythm on the toolbar of the control panel.

    How can do this?

    Hello

    Use this option instead of the toolbar.

    Layout = "vertical" >

    inlineStyle = "float: right;" / >

  • How to set the alignment of the field in a table in jdev 11.1.2.3?

    Hello
    How to set the alignment of the field in a table in jdev 11.1.2.3?
    for example: to display a body of numbers in a table as right aligned.
    I tried to put field (amount) VO UI Hint Format Type: Number; Format: 0000.00
    and jspx, flowing, but it doesnot work.
    Thank you.
    Bao

    < af:column sortProperty = "#{bindings." VO1.hints.amount.name}.
    sortable = "true".
    headerText = "#{bindings." VO1.hints.amount.label}.
    ID = "c44" width = "60".
    Align = "center" >
    < af:inputText value = "#{row.bindings.Amount.inputValue} '"
    label = "#{bindings." VO1.hints.amount.label}.
    required = "#{bindings." VO1.hints.amount.mandatory}.
    columns = "#{bindings." VO1.hints.amount.DisplayWidth}.
    maximumLength = "#{bindings." VO1.hints.amount.precision}.
    shortDesc = "#{bindings." VO1.hints.amount.ToolTip}.
    ID = "it58.
    secret = "false".
    inlineStyle = "" text-decoration: overline; ">"
    < f: validator binding="#{row.bindings.Amount.validator}"/ >
    < / af:inputText >
    < / af:column >

    Hello
    To set a field right alignment in a table:
    It doesnot work when InlineStyle-> text-align: right;
    It works when ContentStyle-> text-align: right;

  • How to set the alignment of the grid as "First line only" for any style of paragraph

    Hello.. Please help me.

    I have to set the alignment of the grid as "First line only" for any paragraph style.

    I use the code below to set the alignment of the grid as "all lines".

    *********************************************************************************

    TextAttributes InterfacePtr < ITextAttributes > (styleInfo, UseDefaultIID());

    AttrGridAlignment InterfacePtr < ITextAttrGridAlignment > (: CreateObject2 < ITextAttrGridAlignment > (kTextAttrGridAlignmentBoss));

    attrGridAlignment-> SetGridAlignment (Text::kGABaseline);

    textAttributes-> ApplyAttribute (attrGridAlignment);

    Here, I created the text attribute of the alignment of the grid and applied to the styleInfo of the style.

    Now, the problem is that I tried all available of Text::GridAlignmentMetric values, but none of them affect the 'first line only. Please tell me the solution of this problem. I'm short on time.

    Thanks in advance.

    You apply this attribute via kEditTextStyleCmdBoss or equivalent? If this is not the case, consider to do.

    kGABaseline is what you need. In addition (see dialogue change style to a "pipe") you will need kTAGridAlignOnlyFirstLineReportBoss - IID_ITEXTATTRBOOLEAN set to true...

    Dirk

  • I want to set the alignment of the Facebook icon on my menu.

    I have trouble getting my Facebook icon to align with my other navigation menu items. Can someone help me with this?

    Tamlyn Akins Art & Design

    Thank you

    Tamlyn

    Are you suggesting that for reasons of design or technique?

    Both.  My reasons are technical and aesthetic. I like SVG icons & fonts for web graphics because:

    (1) easy to style with CSS code.

    (2) print less than JPG & PNG.

    (3) can be adapted to any size you need in your source code.

    (4) icon remains perfectly crisp and clear at any size.

    If you re - to scale an image (JPG, PNG, GIF) raster, it will look blurry and distorted. On the screens of Hi-density (retina), raster images can look downright ugly.

    Increasingly, Web designers are turning to the SVG icons & fonts for logos, social media icons, apps & other web graphics.  Bitmaps are for photos.

    I also have problems now with the maintaining the alignment formatting when I place a hyperlink for the image.

    Which is caused by the CSS of your navigation bar.

    I'm not familiar with the creation of those...

    Fonts-Awesome has a good assortment of icons of social media. Nothing to create for you.  You paste a link to the library of great fonts in your web page.  Add classes and an icon to your HTML code like this:

  • Or if it will be bound

  • Nancy O.

  • How to set the alignment of the cell

    Hello
    Please how to fix the alignment(vertical/horizontal) for the cell. Below the code does not have effect.

    -------
    ARG: = ole2.create_arglist;
    OLE2.add_arg(ARG,1);
    OLE2.add_arg(ARG,1);
    Cell: = ole2. Get_Obj_Property (Worksheet, 'Cells', ARG);
    OLE2.destroy_arglist (ARG);
    OLE2.set_property (Cell, 'Veritcal', 'center');
    --------
    Iqbal

    . HorizontalAlignment = xlGeneral
    . VerticalAlignment = xlTop

    Here, the constant xlTop and xlGeneral are used. I guess they are numeric constants. A quick search for "excel xlTop" in google leads to a link where this code is provided

    var xlTop =-4160;

    -ole2.set_property (Cell, 'HorizontalAlignment', 'xlGeneral');
    OLE2.set_property (Cell, 'VerticalAlignment', 'Top');

    You assign strings here, it's totally different, so maybe try

    ole2.set_property(Cell,'VerticalAlignment',-4160);
    
  • How to set the alignment of a TextFrame in illustrator with extendscript

    Impossible to go out or find something that I can get this to work. I want to make the anchor point on a text object is to the right of the text (right align). I try this:

    If (item.constructor.name == "TextFrame") {}

    item.textRange.ParagraphAttributes.justification = Justification.rightAlign;

    }

    but it does not work. If someone out there tell me what I'm doing wrong

    Thank you

    app.selection[0].paragraphs[0].justification = Justification.CENTER;
    

    Loïc

    http://www.ozalto.com/

  • Issue by setting the value in VO

    Hello
    I'm getting following error highlighting to the VO XxpimRelationshipRulesVO1. are the subject of the VO and FromIccNameTemp the column I'm putting

    I'm inside the AM framework using a loop so much FromIccNameTemp and FromIccName refer to the same database columns.

    rowi.setFromIccNameTemp (rowi.getFromIccName ());

    oracle.jbo.ReadOnlyAttrException: Houston-27008: attribute value for FromIccNameTemp in the object XxpimRelationshipRulesVO1 view failed.

    How to solve this problem.

    Hello

    Check if the VO attribute is updateable in the VO Assistant.

    Thank you
    -Anil

  • How to set the vertical alignment of text in a table style

    I hope I'm missing something easy. I know how vertically and horizontally align text in a table cell.

    What I would do, is to be able to do as well in a style - section, object or character, it doesn't matter - so I don't have to do it manually to each cell in a table. I can't figure out how to put this in a style. Is it possible to do this?

    Thank you

    Marcy

    You create a cell Style. In a cell Style, you can set the vertical Justification on the text panel.

  • C1765nfw copy Issue: printer always takes into account that I have copies of legal size, even though I set the size of the copy as "letter"...

    C1765nfw always guess I make copies of legal size, even if I set the size of the copy as a 'Letter' in the default copy settings.  Paper default tray is also 'Letter' and 8.5 x 11 paper I get incompatibility of paper for each page, because the C1765 is looking for legal size paper. and then have to erase/reset for each page I copy (including multi-page documents) how to fix this?

    I just fixed that for a client, and it was pretty simple. Somehow its default settings for the MPF tray have been changed to legal. Try going to settings of the tray then MPF and change the default to the letter. This corrected it in my case.

  • Satellite L505 - 14 d - Starcraft II - cannot set the resolution of 1366 x 768

    I recently bought this laptop, it has an ATI Mobility Radeon HD 5165 HyperMemory graphics card, however, when I installed the game Starcraft II, and tried to change my graphics settings, told me that my video (could say graph, or display card, I do not remember) card was not recognized, and that I might want to check this... I thought, well, that there is probably no problem, as long as everything works fine, but the problem is this; This isn't. I'm unable to set the resolution of 1366 x 768, which is the maximum resolution of the computer normally. The maximum resolution that I can put in this game is 1280 x 768...

    This starts to become quite annoying, not a HUGE issue by any means, but still, I would like to get this issue resolved. ;)

    My apologies if you have problems to understand what I mean here, that English isn't my mother tongue. Do not hesitate to ask me if you need clarification on anything whatsoever.

    Hello

    > not thought, well, surely this is no problem, as long as everything works fine, but the problem is this; This isn't. I'm unable to set the resolution of 1366 x 768, which is the maximum resolution of the computer normally. The maximum resolution that I can put in this game is 1280 x 768...

    Are you able to set the resolution of 1366 x 768 laptop s display settings?

    If Yes, then I guess that this has nothing to do with the laptop but with the game settings.
    Maybe the game is unable to use a higher resolution because of the pilot or the graphics card compatibility.

    I played a lot of games in the past on my laptop and to be honest game display settings have nothing to do with the general display resolution settings. My laptop resolution is 1400 x 1050, but the different games are available at 1024 x 768 due to the better performance

  • Set the color to a table Cluster

    Is it possible to set the color, if the table, fonts, cluster, etc. on a specific column and row within a table Cluster? Looking at the properties and methods, it does not seem so. I have no other options that rethink my VI?

    Here's an example of how my data are implemented with the sample data provided.

    I would appreciate any advice.

    Interesting that you should raise this issue.  Coincidentally, a similar question was answered just in time:

    https://forums.NI.com/T5/LabVIEW/change-enum-colour-in-a-cluster-that-is-in-an-array/m-p/2918506#U29...

    Check out Jeff's response and see if maybe you can adapt to your problem.

  • Cannot set the time zone of Moscow winter + 3 hours.

    Cannot set the time zone of Moscow winter + 3 hours.
    Set the time zone Minsk 3 after the GPS clock moves forward 1 hour, timezone is set back from Moscow + 4.
    It is an error of your software when you are ready to address this issue.

    Automatic deactivation date & time(Settings>Date&Time...)

  • How to set the printer in VBscript

    I have a folder that contains 20 pdf files, I want to print only 2nd page with 2 copies of all files PDF 20.

    I have VBscript

    ---------

    TargetFolder = "path of file."
    Set objShell = CreateObject
    Set objFolder = objShell.Namespace (TargetFolder)
    Set colItems = objFolder.Items
    For each objItem in colItems
    objItem.InvokeVerbEx ("Print")
    Next

    --------------------------------------------
    here all the files are all print page but how put in 2nd page with 2 copies in 20 pdf files


    This issue is beyond the scope of this site and must be placed on Technet or MSDN

    http://social.msdn.Microsoft.com/forums/en-us/home

Maybe you are looking for