How to get the height in absolute pixels of a control

I have a list of items seen with two hard coded into it.  I take the position of absoultely discovers this list to make it lower edge is a certain coordinate on the screen. (so that it is directly over another point aboslutely placed on the screen)

To do this, I need to know the height of the list view.  I can estimate that by multiplying the number of items in the listview by 111, but obviously it is very fragile.

What is the right way to do it?

This has been asked several times, and of course, it is best to not hardcode the values that they vary depending on the devices and may change in the future.

... you can use a layoutupdatehandler to find dynamically...

http://developer.BlackBerry.com/native/reference/Cascades/bb__cascades__layoutupdatehandler.html

http://supportforums.BlackBerry.com/T5/native-development/how-to-get-a-size-of-BB-Cascades-control-o...

Tags: BlackBerry Developers

Similar Questions

  • How to get the height of the text TextFlow?

    Hello

    I try to get the height of the text from a TextFlow so that I can resize the container accordingly and place other objects dynamically, but I can't seem to find a way to get it.

    Any help would be appreciated.

    Thank you
    Nikos

    Take a look at contentWIdth/contentHeight on the controller. Assuming that you have only one controller its availalable in textFlow.flowComposer.getControllerAt (0)

  • How to get the height and width of the screen of the blackberry device?

    Can someone tellme how to get details of the screen of the blackberry device?

    Display.getWidth () and Display.getHeight ().  If this isn't what you want, let us know.

  • How to get the height of the component (located in %) on its parent creationComplete event

    Hello

    I've got a component with height = 100% ownership. This component has a child with height = 80 percent ownership. I need to get the value of the height of the child on the complete creation of the parent event. Problem is that the size of the child is set to a default value when sends this event. Correct height value is more later (I don't know when).

    I tried to use child.validateNow () and parent.validateNow (), but without result. Any suggestions?

    I should add that this child is inside the tabNavigator to the 2nd tab. There should be no impact if becouse tabNavigator has creationPolicy set to 'all '.

    Looks like than ViewStacks no children available to be chosen so your

    workaround is probably correct.  If we put out all the children, it would be wrong

    even more performance.

  • How to get the height and width of the exact text in TextLayout framework

    Hello fellow developers,.

    I'm starting to work with TLF when there are three different CFC now, I work with unique CFCS with flex 4 and a lot of things are changed as

    I use calculateHeight (), calculateWidth () now these methods are not available.

    If someone knows the replacement of these methods then do let me know.

    Thank you

    If the text exceeds the container, what can happen in a container to scroll where you have to scroll to see some of the text, then returns getContentBounds values are estimated values. It is because we do not want to force the text to recompose all the way at the end of a very long TextFlow in order to return a value. However, if you want to get the exact amount and is not afraid to take the time to redial, call textFlow.flowComposer.composeToPosition (), before calling getContentBounds. This forces all text redial at the end, and then getContentBounds displays the calculated value entirely instead of her estimate.

  • How to get the vertical scroll bar is displayed for control panel

    Hi there, Im a beginner in Flex and I'm working on my first application for a client. I have the most difficult time to get a vertical scroll bar to work for a Panel control, that I use. Here's the overview:

    1. I have a control of the application with a horizontal layout
    2. I have a Vbox left with 2 panels on top of the other,
    3 - I have a Panel on the right with a bunch of text controls just above another.

    the application looks like this. Think fair spaces and dashes since this wont let me enjoy the areas:

    ______________________
    | - - - - - - - - -| - - - - text - - - - |
    | - - - - - - - - -| - - - - text - - - - |
    | - - - - - - - - -| - - - - text - - - - |
    | ---------------| - - - - text - - - - |
    | - - - - - - - - -| - - - - text - - - - | -browser window ends here
    | - - - - - - - - -| - - - - text - - - - |
    | - - - - - - - - -| - - - - text - - - - |
    ______________________


    MY PROBLEM: I would like the application to stay confined to the browser window and have scroll bars appear in the right panel when text controls contained too long for the browser window. Yet, I can't make it work, Ive tried to use clipContent = true and activation verticalScrollPolicy but nothing seems to make the sign on the right contrain at the height of the browser window.

    I have a feeling it's something really simple so any help would be LARGELY APPRECIATED!

    The best
    Stephen

    I have it! Thanks Darin for work through this with me. Liike looks like, I really need the Hbox, so do the layout of Panel = "absolute" as josh suggested. Then wrap all text with a vbox controls, Viola! I get scrolling as expected! Here's the final MXML:


    http://www.Adobe.com/2006/mxml"layout ="horizontal">











    Here is a bunch of text in a single text control

    ]]>





    Ashraf asdawdd wadmdwad mildm awdn wad I niawfnaf nawfn awfn awifn awf

    adsadwadwadawd

    asdadwavawvvawvaw

    ]]>





    asdasdsav

    asdasdsadwninib

    awnvndzln

    qwanil

    asbnil nl

    ]]>




    Thank you very much!
    s

  • How to get the name of a class private data controls?

    How can I get the names of the controls within a class private data?

    I use the framework of the actor and try to create a tha method will be executed when run the actor. This method should an o list all names of control inside the data class to find the initial value within a configuration file (config.ini file), the key to the configuration file will be the name of the control.

    Thank you.

    You already do the substitution method just because you write for the bundle by name.  And then how are you going to respond to all types of data might be the key.  You do more difficult things that it takes to really very few benefits.

  • How to get the height of the action bar?

    All simple functions?

    You can use this view you:

    this.navigator.actionBar.height

  • Get the height of the strings

    Hello..

    can someone tell me how to get the height of the chain

    My String is "Blackberyy developer \n".

    I got it..

  • get the height and width of the screen in QML?

    How to get the height and width of the screen in QML?

    Please search the forums before you make a new post. This post is still on the first page... http://supportforums.BlackBerry.com/T5/Cascades-development/correct-way-to-get-display-width-height-...

  • How to get the bar display of title in pixels text length?

    Hello

    Does anyone know how to get the length of the title bar text (in pixels) display?  Just to clarify, that's what I'm looking for:

    I don't see a CVI function for this.  The attribute ATTR_TITLE_FONT for GetPanelAttribute (...) is only valid for the panels of the child which prevents me from using the GetTextDisplaySize (...) to get the size.  Dive into the Windows SDK I can not even find an answer here.  Any ideas?  Thank you.

    Figured out how to do this.  Go to the SDK to get the font properties - is kind of nonobviousness.  But once you have the font properties, you can create a font of meta in CVI, with properties, and once you have the meta font you can use GetTextDisplaySize (...) to get the size.  For any future reference:

    //define a NONCLIENTMETRICS structureNONCLIENTMETRICS ncmtest;//We have to set the cbSize parameter to the size of the passed structure before retrieving it
    ncmtest.cbSize = sizeof(NONCLIENTMETRICS);
    //Get NONCLIENTMETRICS structure
    result = SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncmtest, 0);
    
    //copy the title font name to a c-string
    while(ncmtest.lfCaptionFont.lfFaceName[i] != 0)
    {
        thefont[i] = (char)ncmtest.lfCaptionFont.lfFaceName[i];
        ++i;
    }
    
    //null terminate
    thefont[i] = '\0';
    
    //create meta font with title font properties.  lfWeight & 0x700 indicates bold.  CreateMetaFontWithCharacterSet() doesn't recognize DEFAULT_CHARSET so we replace it with VAL_NATIVE_CHARSET(?).
    uir_status = CreateMetaFontWithCharacterSet ("TheTitleFont", thefont, abs(ncmtest.lfCaptionFont.lfHeight), ncmtest.lfCaptionFont.lfWeight & 0x700 ? 1 : 0, ncmtest.lfCaptionFont.lfItalic, ncmtest.lfCaptionFont.lfUnderline, ncmtest.lfCaptionFont.lfStrikeOut, 0, ncmtest.lfCaptionFont.lfCharSet == DEFAULT_CHARSET ? VAL_NATIVE_CHARSET : ncmtest.lfCaptionFont.lfCharSet);
    
    //get titlebar text
    uir_status = GetPanelAttribute (panelhandle, ATTR_TITLE, thetext);
    //get title bar length
    uir_status = GetTextDisplaySize (thetext, "TheTitleFont", &height, &width);
    

    I have a 79 for the duration of the screenshot above.

  • How to get the RGB value of a pixel in a psd document using scripting Photoshop

    Hi, guys!    Does anyone know how to get the RGB value of a pixel in a psd document using scripts in Photoshop?  I myself have missed for a long time and could not resolve. I am very happy to hear your voice as soon as possible!

    Here is an example...

    var originalUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    var doc = activeDocument;
    var Colour1 = GetHexColour(eyeDropperRGB(1,doc.height-1));
    var Colour2 = GetHexColour(eyeDropperRGB(20,doc.height-5));
    var Colour3 = GetHexColour(eyeDropperRGB(40,doc.height-14));
    alert("Colour 1 = " +Colour1 + "\rColour 2 = " +Colour2 + "\rColour 3 = " +Colour3);
    var decColour = eyeDropperRGB(40,doc.height-14);
    alert("Red = " +decColour[0] + "\rGreen = " +decColour[1] + "\rBlue = " +decColour[2]);
    app.preferences.rulerUnits = originalUnits;
    function GetHexColour(reqHex){
    var out='';
    for(No in colours = reqHex){
     out = out.concat(zeroPad(d2h(reqHex[No]),2));
     }
    return out;
    };
    function eyeDropperRGB(x,y) {
     var x2 = x + 1;
     var y2 = y + 1;
     var out = new Array(3);
     activeDocument.selection.select([[x,y], [x2,y], [x2,y2], [x, y2]], SelectionType.REPLACE, 0, false);
     for(ch in list = ["Red", "Green", "Blue"]) {
     histogram = activeDocument.channels[list[ch]].histogram;
      for (i = 0; i <= 255; i++) {
       if (histogram[i]) {
        out[ch] = i;
        break;
       }
      }
     }
      return out;
    };
    function d2h(d) {return d.toString(16);}
    function zeroPad(n, s) {
       n = n.toString();
       while (n.length < s)  n = '0' + n;
       return n;
    };
    
  • How to get the color of a single pixel?

    Hi all.

    Part of my application is transparent. The other party is not.

    But I would like to have 'match' colors (is not very pretty orange to pink, but it's a matter of personal taste, I guess).

    That's why I need now to a background color.

    That's what I had in mind:

    Because we cannot get information about the currently active theme, I can do a screen capture and extract a single pixel of interest and get its color information. If it is green (for example) - I'll tryto use more Brown colors in my application.

    So basically, is it possible to get the color of a pixel in a bitmap (or something?)

    My last resort would be to save the Bitmap image to a file and then read that file.

    Bitmap.getARGB (int [] argbData, int offset, int scanLength, int x, int y, int width, int height)
    Gets the raw data ARGB region of this Bitmap and stores it in the table provided.

  • How to get the width and height of Flex Mobile view?

    Hello

    The following instructions can get the width and height of the current Flex app:

    var request: UIComponent = FlexGlobals.topLevelApplication as UIComponent;

    trace (application. Width);

    trace (application. Height);

    But I don't know how to get the width and height of mobile display Flex current (i.e. the content size excludes bar action and the Navigation bar). Why the "this.width" always returns 0?

    Thank you!

    Looks like you're running in this bug: https://bugs.adobe.com/jira/browse/SDK-30070

  • How to get the property of the image on the width and height?

    Hi, all, I import image from the outside with the following method, but how to get the w3c_main.png on the width and height property? I will appreciate for your answer.

    var mcLoader = new MovieClipLoader()
    mcLoader.loadClip (" http://www.w3.org/Icons/w3c_main.png", image);

    or an image. LoadMovie (" http://www.w3.org/Icons/w3c_main.png")

    in the first case use the method onLoadInit() to a listener for your mcl before trying to access your target movieclip laborious and _height properties.

    in the second, use the preloader code to ensure your png loading is completed before attempting to access the _width and _height of your target movieclip properties image.

Maybe you are looking for

  • TruNote update of ancient tablets excite write?

    Hello Toshiba will not issue an upgrade to TruNote for the first generation users excite write?Indeed I've seen an article on PCWorld showing that this software is updated and released on their new Tablet excite write... Thank you

  • Updating BIOS on a Tecra M4?

    I have a Tecra M4 2006 and it was check for Vista compatibility - it seems that it is a no-go for now (maybe a different subject if I have a sticker 'compatible windows vista' and its far from compatible I see) However, he did ask me to try to update

  • Importers new bookmarks from Safari will create replicas

    I already imported most of my favorites, but it's been a while since then, and I would add those that I've gained since. However, I am concerned, he will simply double those I already, as well as the most recent addition. FF will know not not to add

  • HP Compaq 6000 Pro SFF: PCI Simple Communications Controller Driver Windows 7

    Good afternoon everyone, I'm in the middle of installing Windows 7 on a 6000pro but I could not find the driver for the controller PCI of communication Simple. The hardware ID is: PCI\VEN_8086 & DEV_2E14 & SUBSYS_3048103C & REV_03 PCI\VEN_8086 & DEV_

  • System image recovery question

    Recently, I managed to get my HP Envy laptop (model: E1P05AV) sent repair due to confer a certain problems. I was wondering if restore a system image on it it when I came back would cause problems back to the image. Wouldn't be better to simply resto