HorizontalFieldManager の Background を設定したいです。私が探していたサンプル コードは、メイン画面の背景にグラデーションを使用して背景を設定しています。
//create gradient linear for background
this.getMainManager().setBackground(BackgroundFactory.createLinearGradientBackground(0x0099CCFF,
0x0099CCFF,0x00336699,0x00336699)
);
次に、このメソッドがあるため、同じパターンを使用して背景を HorizontalFieldManager に設定しようとします。しかし、それはうまくいきません。これがコードです
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);
HorizontalFieldManager を使用して 4 つの BitmapField を追加し、BackgroundFactory を使用して solidBackground を作成し、マネージャーに設定しましたが、実行すると背景色が適用されません。グラデーションの例はうまく機能します。不足しているものはありますか?私を助けてください。
ありがとう