Note that there are some explanatory texts on larger screens.

plurals
  1. POPlacing one field to be center and another field to be bottom in blackberry
    primarykey
    data
    text
    <p>I want to display one <code>BitmapField</code> to be at the center of the whole screen and one more at the bottom of the Screen.</p> <p>I am not able to generate the correct UI.</p> <p>I tried like this - using this I am able to place one bitmap on bottom, but not able to keep the center <code>BitmapField</code>.</p> <p>Please anyone help me to resolve this.</p> <pre class="lang-java prettyprint-override"><code>VerticalFieldManager vfm = new VerticalFieldManager(VerticalFieldManager.USE_ALL_HEIGHT | VerticalFieldManager.USE_ALL_WIDTH) { //Override the paint method to draw the background image. public void paint(Graphics graphics) { graphics.setBackgroundColor(Color.DEEPSKYBLUE); graphics.clear(); super.paint(graphics); } }; add(vfm); HorizontalFieldManager customManager = new HorizontalFieldManager(HorizontalFieldManager.USE_ALL_WIDTH) { /* (non-Javadoc) * Applying background color for that Manager * @see net.rim.device.api.ui.Manager#paint(net.rim.device.api.ui.Graphics) */ public void paint(Graphics graphics) { graphics.setBackgroundColor(Color.DEEPSKYBLUE);//blue graphics.clear(); super.paint(graphics); } /* (non-Javadoc) * Placing the Fields * @see net.rim.device.api.ui.container.HorizontalFieldManager#sublayout(int, int) */ protected void sublayout(int width, int height) { setPositionChild(getField(0), 0, 0); layoutChild(getField(0), getField(0).getPreferredWidth(), getField(0).getPreferredHeight()); setPositionChild(getField(1), Display.getWidth()/2 - getField(1).getPreferredWidth()/2, 0); layoutChild(getField(1), getField(1).getPreferredWidth(), getField(1).getPreferredHeight()); setPositionChild(getField(2), Display.getWidth() - getField(2).getPreferredWidth(), 0); layoutChild(getField(2), getField(2).getPreferredWidth(), getField(2).getPreferredHeight()); setExtent(width, 50); } }; //To display About icon final Bitmap bmp1 = Bitmap.getBitmapResource("a.png"); BitmapField bmpfield1 = new BitmapField(bmp1, BitmapField.FOCUSABLE | BitmapField.FIELD_LEFT){ //To Perform action on clicking the bitmap field protected boolean navigationClick(int status, int time) { UiApplication.getUiApplication().pushScreen(new AboutScreen()); onUnfocus(); return true; } protected void onFocus(int direction) { super.onFocus(direction); } protected void onUnfocus() { super.onUnfocus(); invalidate(); } }; //To display Help icon final Bitmap bmp2 = Bitmap.getBitmapResource("b.png"); BitmapField bmpfield2 = new BitmapField(bmp2,BitmapField.FOCUSABLE | BitmapField.FIELD_RIGHT){ //To Perform action on clicking the bitmap field protected boolean navigationClick(int status, int time) { UiApplication.getUiApplication().pushScreen(new OpenBrowserScreen("")); onUnfocus(); return true; } protected void onFocus(int direction) { super.onFocus(direction); } protected void onUnfocus() { super.onUnfocus(); invalidate(); } }; //To display Title Bitmap final Bitmap bmp3 = Bitmap.getBitmapResource("c.png"); BitmapField bmpfield3 = new BitmapField(bmp3, BitmapField.FIELD_VCENTER | BitmapField.FOCUSABLE); bmpfield3.setBitmap(bmp3); //Adding the Three fields to the manager customManager.add(bmpfield1); customManager.add(bmpfield3); customManager.add(bmpfield2); vfm. add(customManager); bmpfield3.setFocus(); HorizontalFieldManager hfm = new HorizontalFieldManager(Field.FIELD_HCENTER); //VerticalFieldManager vfmfields = new VerticalFieldManager(VerticalFieldManager.FIELD_HCENTER|Field.USE_ALL_HEIGHT); bmpscan = Bitmap.getBitmapResource("test1.png"); bmpfieldscan = new BitmapField(bmpscan,BitmapField.FOCUSABLE |Field.FIELD_VCENTER); hfm.add(bmpfieldscan); vfm.add(hfm); HorizontalFieldManager hfmacnts = new HorizontalFieldManager(HorizontalFieldManager.USE_ALL_HEIGHT | HorizontalFieldManager.FIELD_BOTTOM); bmpacnts = Bitmap.getBitmapResource("test2.png"); bmpfieldacnts = new BitmapField(bmpacnts,BitmapField.FOCUSABLE | Field.FIELD_BOTTOM) { protected boolean navigationClick(int status, int time) { return true; } }; hfmacnts.add(bmpfieldacnts); vfm.add(hfmacnts); </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    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