Mobile Development 10.11 | webMethods Mobile SuiteWeb Help | 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) is considered 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 is a new property added to Mobile Designer 9.12. Using BackgroundDrawable, you can 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 required)
*PatternImage for images (with optional tiling or scaling if memory and platform support allows)
*DefaultBackground for the default background behavior of this element. Use the static reference DefaultBackground.DEFAULT if you want to reset a NativeUI object to it's default background.
Wherever possible, consider using the BackgroundDrawable property in preference to Bgcolor.