Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to change Background of HorizontalFieldManager
    primarykey
    data
    text
    <p>I want to set the Background of HorizontalFieldManager. The sample code I've been searching is setting the background using Gradient for the main screen background.</p> <pre><code> //create gradient linear for background this.getMainManager().setBackground(BackgroundFactory.createLinearGradientBackground(0x0099CCFF, 0x0099CCFF,0x00336699,0x00336699) ); </code></pre> <p>Then I try to use the same pattern to set background to HorizontalFieldManager, since it have this method. But it won't work. Here's the code</p> <pre><code> HorizontalFieldManager hManager = new HorizontalFieldManager(); Bitmap bitmapImage = null; bitmapImage = Bitmap.getBitmapResource("img/home.png"); tabHome = new BitmapField(bitmapImage, BitmapField.FOCUSABLE | BitmapField.HIGHLIGHT_FOCUS); bitmapImage = Bitmap.getBitmapResource("img/in.png"); tabCheckInOut = new BitmapField(bitmapImage, BitmapField.FOCUSABLE | BitmapField.HIGHLIGHT_FOCUS); bitmapImage = Bitmap.getBitmapResource("img/barcode.png"); tabBarcode = new BitmapField(bitmapImage, BitmapField.FOCUSABLE | BitmapField.HIGHLIGHT_FOCUS); bitmapImage = Bitmap.getBitmapResource("img/options.png"); tabOptions = new BitmapField(bitmapImage, BitmapField.FOCUSABLE | BitmapField.HIGHLIGHT_FOCUS); tabHome.setFocusListener(this); tabCheckInOut.setFocusListener(this); tabBarcode.setFocusListener(this); tabOptions.setFocusListener(this); Background topBack = BackgroundFactory.createSolidBackground(0x00606A85); hManager.setBackground(topBack); hManager.add(tabHome); hManager.add(tabCheckInOut); hManager.add(tabBarcode); hManager.add(tabOptions); add(hManager); </code></pre> <p>I'm using HorizontalFieldManager and add 4 BitmapField, then I using BackgroundFactory to create solidBackground, and set it to the manager but when I run it, the background color does not apply. The gradient example work well. Is there anything that I'm missing? Please help me.</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload