I am trying to design dynamic forms based on user choice.

for example i can have a list of form controls like TextView, Button,
RadioButton etc and when click on add the selected control should be
added on the screen.

i have done a little work on that and able to add the control bot i
could not manage to break line i mean all controls are added on the
single line ...... here is my code.....

[code]

                public void onClick(View v) {
                        int i=compList.getSelectedItemPosition();

                        Log.w("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]

--~--~---------~--~----~------------~-------~--~----~
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