3

I have to create Text Views and Edit Texts dynamically and insert it inside the linear layout(horizontal) which is already declared in the XML file. Number of Text Views and Edit Texts to be inserted varies dynamically. I am creating the views dynamically and adding it to the linear layout.But the problem is that if number of views is more it moves out of the screen in spite of coming in the next line.what should I do to make the views come in next line if no space is available.

Nishant
  • 32,082
  • 5
  • 39
  • 53

3 Answers3

1

There is currently no Android layout with that behaviour.

Nevertheless, it has already been tackled in other threads (such as Android - LinearLayout Horizontal with wrapping children), which provide guidance on how to implement such a layout.

Community
  • 1
  • 1
jcxavier
  • 2,232
  • 1
  • 15
  • 24
0

You can't do it with linearlayout, try tablelayout!

viplezer
  • 5,519
  • 1
  • 18
  • 25
0

Use ScrollView and add your LinearLayout into ScrollView.

animuson
  • 53,861
  • 28
  • 137
  • 147
Sam
  • 322
  • 1
  • 6