开发者

Android:Dynamic add Edit Text Box in a Linear Layouts?

开发者 https://www.devze.com 2023-02-13 03:27 出处:网络
Hi I have a Linear Layout itsorientation=\"vertical and it contains3 Edit Box By default .When i click Add Button ,I want to create n开发者_JAVA技巧ext Edit Box Dynamically ,under the previous Edit bo

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 .

please Help me
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.

0

精彩评论

暂无评论...
验证码 换一张
取 消