Building Mobile Enterprise Applications : webMethods Mobile Designer Native User Interface Reference : Mobile Designer Native User Interface : Background Colors and Images
Background Colors and Images
The background of most NativeUI elements can be changed using two properties, Bgcolor and BackgroundDrawable. Setting a value for Bgcolor will override any previously set BackgroundDrawable, and similarly, setting a BackgroundDrawable will override any previous Bgcolor.
Bgcolor is the older of the two properties, and has been extended in Mobile Designer 9.12 to support more NativeUI elements (as platform support allows). As the name suggests, Bgcolor can only influence background colors. Setting Bgcolor's value to nUIDisplayObject.COLOR_BACKGROUND_NORMAL (0xFFFE00FF), will be taken as a special value and corresponds to whatever the platform would normally do for this element, so it cannot be set directly as a literal color value.
BackgroundDrawable, on the other hand, is a new property added to Mobile Designer 9.12. Using BackgroundDrawable, it is possible to get a much wider set of options for a NativeUI object. A new package, com.softwareag.mobile.runtime.nui.background, contains the three types of background classes that can be set:
*ColorBackground for raw color values (including the literal value of COLOR_BACKGROUND_NORMAL, if that is desired),
*PatternImage for Images (with optional tiling or scaling as memory and platform support allows), and
*DefaultBackground for the default background behaviour for this element. Use the static reference DefaultBackground.DEFAULT if you wish to reset a NativeUI object to it's default background.
Wherever possible, consider using the BackgroundDrawable property in preference to Bgcolor.
Copyright © 2007-2017 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback