I created the mainLayout with two buttons
Add: to add another layout < P> Remove: To remove other layouts
& lt; Button Android :. id = "@ + id / btnAdd" Android: Add text style = "bold" Android: Layout_width = "Fill_parent" Android: layout_height = "Wrap_content" android: layout_gravity = "center_horizontal" android: text = "view" android: onClick = "AddView" /> & Lt; Button android: id = "@ + id / btnRemove" android: text-style = "bold" Android: Layout_width = "Fill_parent" Android: Layout_height = "Wrap_content" Android: Layout_gravity = "Center_horizontal" android: text = "Remove View" Android: onClick = "removeView" /> Now I when I addView button
LayoutInflater inflater = (LayoutInflater) wrote the following code to add click this.getSystemService (LAYOUT_INFLATER_SERVICE) Views ; Scene = inflater.inflate (R.layout.other_layout, tap); MainLayout.addView (see); The view has been added below with the main layout How can I do this
Div class = "post-text" itemprop = "text">
Add a framelayout between two buttons
then Increasing your view on runtime in FrameLayout.
LayoutsInflar = (Layout Inflator) this.getSystemService (LAYOUT_INFLATER_SERVICE); Scene = inflater.inflate (R.layout.other_layout, tap); MyframeLayout.addView (see);
Comments
Post a Comment