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

