主屏幕黑莓手机顶部的搜索栏 [英] Search bar on top of the mainscreen blackberry
问题描述
我要在主屏幕顶部制作一个搜索栏,并且该搜索栏应包含一个编辑域和一张搜索图标图像. 请帮助我...
I want to make one search bar on top of the mainscreen and this search bar should include one editfield and one image of search icon. Please help me...
先谢谢
推荐答案
您需要使用HorizontalFieldManager将editfield和image放在同一行上.在此处阅读 http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/ui/container/HorizontalFieldManager.html 和此处:
You need to use an HorizontalFieldManager to put editfield and image on the same line. Read here http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/ui/container/HorizontalFieldManager.html and here: http://www.androidadb.com/class/ho/HorizontalFieldManager.html , a simple example showing how adding two buttons in an HorizontalFieldManager. Just substitute buttons with yor needed fields.
或者您可以玩GridFieldMgr:
Or you can play with GridFieldMgr:
GridFieldManager gridMgr_g = new GridFieldManager(1, 2, 0);
gridMgr_g.setColumnProperty(0, GridFieldManager.FIXED_SIZE, screenWidth-myBitmapRes.width);
gridMgr_g.setColumnProperty(1, GridFieldManager.FIXED_SIZE, myBitmapRes.width);
gridMgr_g.add(new EditField());
gridMgr_g.add(new BitmapField(Bitmap.getBitmapResource(myBitmapRes)));
add(gridMgr_g);
这篇关于主屏幕黑莓手机顶部的搜索栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!