Hi, you can do it. Here is an example:

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        AbsoluteLayout al = new AbsoluteLayout(this);
        LinearLayout topLayout = new LinearLayout(this);
        topLayout.setOrientation(LinearLayout.VERTICAL);

        EditText et1 = new EditText(this);
        EditText et2 = new EditText(this);
        Button bt1 = new Button(this);
        bt1.setText("Butotn1");
        Button bt2 = new Button(this);
        bt2.setText("Button2");

        LinearLayout ll1 = new LinearLayout(this);
        ll1.setOrientation(LinearLayout.HORIZONTAL);

        ll1.addView(bt1, new
LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
        ll1.addView(et1, new
LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));

        LinearLayout ll2 = new LinearLayout(this);
        ll2.setOrientation(LinearLayout.HORIZONTAL);

        ll2.addView(bt2, new
LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
        ll2.addView(et2, new
LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));

        topLayout.addView(ll1, new
LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT));
        topLayout.addView(ll2, new
LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT));

        LinearLayout bottomLayout = new LinearLayout(this);
        bottomLayout.setOrientation(LinearLayout.HORIZONTAL);
        Button bt3 = new Button(this);
        bt3.setText("Button3");
        Button bt4 = new Button(this);
        bt4.setText("Button4");
        bottomLayout.addView(bt3, new
LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
        bottomLayout.addView(bt4, new
LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));

        al.addView(topLayout, new AbsoluteLayout.LayoutParams(320,
250, 0, 0));
        al.addView(bottomLayout, new AbsoluteLayout.LayoutParams(320,
50, 0, 390));
        setContentView(al);
    }


On 6 nov, 03:28, "Khaled Sliman" <[EMAIL PROTECTED]> wrote:
> I am a noobie too, but I foun droiddraw very usefull for ui , just google
> droiddraw
>
> On Nov 5, 2008 9:03 PM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> Hi All,
>
> I want to make a simple application, this app will have a row of
> buttons in the bottom and two text fields up top with two buttons. I
> cannot seem to do this, granted I'm not an expert with UI's but it
> seems like I cannot do what I want. I was thinking of having two
> linear layouts in my app, a bottom for the buttons, and a top for the
> fields. How would I go about doing this?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to