IDE: Eclipse
Simulator
When I add a label to BorderLayout.SOUTH and then set the label to "" the
height of the label shrinks to 0 or maybe 1 pixel. It seems to happen when
using the map container. When I just add it to a simple form, it doesn't
shrink, however when I add it to a form that also contains mapcontainer
then it makes the label disappear.
The code below reproduces the problem
public class FrmMap extends com.codename1.ui.Form {
protected MapContainer cnt = new MapContainer(new
GoogleMapsProvider("AIzaSyDq8k10JtB2aViAR30rKK-o2zfCAgTQg-0"));
Container cntMain = new Container(new BorderLayout());
protected Label lblStatus = new Label("Status");
public FrmMap() {
this(Resources.getGlobalResources());
}
public FrmMap(Resources resourceObjectInstance) {
initManualComponents();
Display.getInstance().callSerially(() -> {
centerMapToLocation();
});
}
protected void initManualComponents() {
setLayout(new BorderLayout());
setTitle("Map");
setName("FrmMap");
this.setScrollable(false);
cnt.addMapListener(new MapListener() {
@Override
public void mapPositionUpdated(Component source, int zoom, Coord center) {
onMapUpdate(zoom, center);
}
});
cntMain.add(BorderLayout.CENTER, cnt);
cntMain.add(BorderLayout.SOUTH, lblStatus);
this.add(BorderLayout.CENTER, cntMain);
}
protected void centerMapToLocation() {
LocationManager l = LocationManager.getLocationManager();
l.setLocationListener(new LocationListener() {
public void locationUpdated(Location loc) {
Coord c = new Coord(loc.getLatitude(), loc.getLongitude());
cnt.zoom(c , 13);
l.setLocationListener(null);
onMapUpdate(13, c);
}
public void providerStateChanged(int newState) {
}
});
}
protected void onMapUpdate(int zoom, Coord center) {
cnt.clearMapLayers();
cnt.addMarker(null,
center,
"Test", "Test",
new ActionListener<ActionEvent>() {
public void actionPerformed(ActionEvent evt) {
onClickList();
}
}
);
lblStatus.setText("");
}
protected void onClickList() {
Log.p("Clicked");
}
}
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/0d508902-8876-49df-842d-cda223bb324b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.