Android:Dynamic add Edit Text Box in a Linear Layouts?
Hi
I have a Linear Layout its orientation="vertical
and it contains 3 Edit Box By default .When i click Add Button ,I want to create n开发者_JAVA技巧ext Edit Box Dynamically ,under the previous Edit box .When click Save button i want to get all contents of edit box .
Augustine
You can create a new EditText and then add it to the linear layout using ViewGroup.addView. Make sure that when you add the view, you create a new LinearLayout.LayoutParams. As for getting the contents, you can use ViewGroup.getChildAt() to fetch out the EditTexts.
精彩评论