You probably need to set the orientation of the LinearLayout to
vertical.

On Mar 26, 1:04 am, Ahmad Nadeem <[email protected]> wrote:
> > On Thu, Mar 26, 2009 at 1:01 PM, Ahmad <[email protected]> wrote:
>
> >> I want to create a form designer application like user can create
> >> custom form layouts ...... there might be
>
> >> a list of all available controls (TextView, EditText, Button,
> >> RadioButton etc.... ) and an add button and
>
> >> user can add his new form layout on android that can be further saved
> >> on android using sqllight.
>
> >> i have started work on that but i could not break line ..... all
> >> controls are added on the same line ......
>
> >> here is my code that executes on button click
>
> >> [code]
>
> >>               �...@override
> >>                public void onClick(View v) {
> >>                        int i=compList.getSelectedItemPosition();
>
> >>                        Log.w("3 -- CreateNewForm", "onClick : selected
> >> item index
> >> is :"+i );
> >>                                switch (i) {
> >>                                case 0:
> >>                                        LinearLayout layout = new
> >> LinearLayout(getApplicationContext());
> >>                                        TextView label = new
> >> TextView(getApplicationContext());
> >>                                        EditText txt = new
> >> EditText(getApplicationContext());
> >>                                        label.setText("untitled");
> >>                                        label.setPadding(5, 3, 10, 3);
> >>                                        layout.addView(label);
> >>                                        layout.addView(txt);
>
> >>                                        LinearLayout container =
> >> (LinearLayout)
>
> >> findViewById(R.id.compDetails);
> >>                                        container.addView(layout);
> >> //                                      container.addView(textView);
>
> >>                                        break;
> >>                                default:
> >>                                        break;
> >>                                }
> >>                }
>
> >> [/code]
>
> here compDetails is another LinnerLayout that is already present on the
> layout.
>
> --
> Ahmad Nadeem
> J2EE Software Engineer
> Archimedes Services Ltd.http://www.linkedin.com/in/ahmadnadeem
--~--~---------~--~----~------------~-------~--~----~
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