×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Sep 2012
    Location
    Timisoara, Romania
    Posts
    19

    Wich Layout Manager to choose in LWUIT ?

    I need this kind of layout

    http://dl.dropbox.com/u/24709506/Layout.jpg

    two buttons in one row (their width equal and dynamic changed with potrait / landscape orientation) and several buttons spanning bellow, again their width dynamic changed with potrait / landscape orientation.

    Nokia SDK 2.0 + LWUIT 1.0

  2. #2
    Registered User
    Join Date
    Mar 2013
    Location
    United Kingdom
    Posts
    161

    Re: Wich Layout Manager to choose in LWUIT ?

    GridLayout is almost certainly the most flexible layout manager for your purpose.

  3. #3
    Registered User
    Join Date
    Sep 2012
    Location
    Timisoara, Romania
    Posts
    19

    Re: Wich Layout Manager to choose in LWUIT ?

    Thank you for your answer, but how to create spanning in GridLayout ?
    Meanwhile a checked TableLayout, it seems that I can set spanning and percent width, like in HTML. But I can't find how to do this in GUI Builder. Maybe old good coding is better for UI creation ? We have some things not covered by this Builder ?

  4. #4
    Registered User
    Join Date
    Sep 2012
    Location
    Timisoara, Romania
    Posts
    19

    Re: Wich Layout Manager to choose in LWUIT ?

    OK, after some learning, I found the solutions. Coding:

    Code:
            TableLayout layout = new TableLayout(3, 2);
            
            TableLayout.Constraint constraint = layout.createConstraint();
            
            mainForm.setLayout(layout);
    
            constraint = layout.createConstraint();
            constraint.setWidthPercentage(50);
            Button but1 = new Button("Button 1");
            mainForm.addComponent(constraint,but1);
            
            constraint = layout.createConstraint();
            constraint.setWidthPercentage(50);
            Button but2 = new Button("Button 2");
            mainForm.addComponent(constraint,but2);
            
            constraint = layout.createConstraint();
            constraint.setHorizontalSpan(2);
            Button span1 = new Button("Button 3");
            mainForm.addComponent(constraint, span1);
            
            constraint = layout.createConstraint();
            constraint.setHorizontalSpan(2);
            Button span2 = new Button("Button 4");
            mainForm.addComponent(constraint, span2);
    And I found also Constraints in GUI Builder, on button Properties, LayoutConstraint.

  5. #5
    Registered User
    Join Date
    Mar 2013
    Location
    United Kingdom
    Posts
    161

    Re: Wich Layout Manager to choose in LWUIT ?

    You beat me to it Adi

    I should have stated that I like GridLayout because it dynamically resizes itself, this is useful for when you're modifying your views in my experience.

Similar Threads

  1. Layout LWUIT
    By kumar1234567 in forum Mobile Java General
    Replies: 6
    Last Post: 2011-04-26, 05:58
  2. Layout problem LWUIT
    By rajan701v in forum Mobile Java General
    Replies: 1
    Last Post: 2011-03-07, 13:29
  3. Replies: 14
    Last Post: 2010-11-23, 15:32
  4. Layout Manager or SizeChanged() ?
    By Daneel in forum Symbian User Interface
    Replies: 4
    Last Post: 2009-11-29, 22:46
  5. S60 3rd FP2: race condition in layout manager?
    By schoenke in forum Mobile Java General
    Replies: 2
    Last Post: 2009-08-31, 20:40

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •