我想製作一個標籤欄,它將顯示在幾個MainScreens的底部,我認爲創建一個班級是正確的選擇。黑莓通過另一個班級向MainScreen添加字段
由於我是新手,這個問題並不出乎意料,因爲當我嘗試在我的課程中添加一個字段時,它如何將它放置在MainScreen中?我是否必須向我想要使用的屏幕發送某種參考?
package mypackage;
import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.container.HorizontalFieldManager;
public class CustomTabBar {
private HorizontalFieldManager bar;
public CustomTabBar(){
}
public void buildBar(){
bar = new HorizontalFieldManager();
add(bar); //Where am I adding this?!
Bitmap eventIcon = Bitmap.getBitmapResource("eventsicon.png");
Bitmap eventIcon_hover = Bitmap.getBitmapResource("eventsicon-hover.png");
CustomMenuField eventIconField = new CustomMenuField(eventIcon_hover,eventIcon, "TheatreScreen");
}
}