webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

wMMD-Android: Positioning of nuiImageElement

  • 1.  wMMD-Android: Positioning of nuiImageElement

    Posted Wed February 22, 2012 02:52 PM

    Hi all,
    could anyone please give a hint on how the positioning of nuiImageElements for Android works?

    Let’s say we put such an element on the start_view of the nativeUIHelloWorld sample.
    Then we have something like:

    nUIImageElement element = new nUIImageElement(-1, image);
    element.setWidth(image.getWidth()); // maybe not necessary for android
    element.setX(0);
    start_view.add(element);

    The image would then appear left-aligned in Phoney but somewhere in the middle of the screen for Android.
    To have the image left-aligned on an android device, I would need to “setX” it to a strange number like -336 …
    it then is not even visible on Phoney any more …

    Could anyone help on this?

    Regards,
    David


    #webMethods
    #Integration-Server-and-ESB
    #mobile
    #webMethods-General


  • 2.  RE: wMMD-Android: Positioning of nuiImageElement

    Posted Wed February 22, 2012 05:03 PM

    Hi David,

    setWidth is likely to be modified to throw an Exception further down the line - the width/height of an ImageElement is driven by the image’s dimensions, not by an integer setter value passed in. For what you’re trying, I suggest using the setAlign method, as demonstrated on the “Images” view in NativeUIDemo - the default alignment is ‘center’ on the screen.

    Regards,

    Nick.


    #webMethods
    #mobile
    #Integration-Server-and-ESB
    #webMethods-General