BTW, here is a complete Form that shows the problem
import com.codename1.ui.Button;
import com.codename1.ui.Container;
import com.codename1.ui.FontImage;
import com.codename1.ui.Label;
import com.codename1.ui.layouts.BorderLayout;
import com.codename1.ui.plaf.UIManager;
import com.codename1.ui.table.TableLayout;
import com.codename1.ui.table.TableLayout.Constraint;
public class FrmMain extends com.codename1.ui.Form {
TableLayout layout = new TableLayout(4,4);
private Container cnt1 = new Container(layout);
Button btnSave = new Button("Save",
FontImage.createMaterial(FontImage.MATERIAL_FOLDER,
UIManager.getInstance().getComponentStyle("Command")));
Button btnSave2 = new Button("Save2",
FontImage.createMaterial(FontImage.MATERIAL_FOLDER,
UIManager.getInstance().getComponentStyle("Command")));
public FrmMain() {
this(com.codename1.ui.util.Resources.getGlobalResources());
}
public FrmMain(com.codename1.ui.util.Resources resourceObjectInstance) {
initManualComponents();
}
protected void initManualComponents() {
this.setLayout(new BorderLayout());
layout.setGrowHorizontally(true);
Constraint c1 = layout.createConstraint().horizontalSpan(1);
c1.setWidthPercentage(25);
cnt1.add(c1, new Label("Version:"));
Constraint c2 = layout.createConstraint().horizontalSpan(3);
c2.setWidthPercentage(75);
cnt1.add(c2, new Label("Test"));
Constraint c3 = layout.createConstraint().horizontalSpan(2);
c3.setWidthPercentage(50);
cnt1.add(c3, btnSave);
Constraint c4 = layout.createConstraint().horizontalSpan(2);
c4.setWidthPercentage(50);
cnt1.add(c4, btnSave2);
this.add(BorderLayout.CENTER, cnt1);
}
}
On Tuesday, July 19, 2016 at 10:26:24 PM UTC-7, Shai Almog wrote:
>
> I don't think you quite understand the idea of spanning here. If you want
> to increase the width of the table spanning will make no difference. You
> need to use the width constraint.
>
--
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/e8fc1954-c8fd-418e-827e-9f99316ddaf8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.