I’m adding TextViews dynamically with code. Now I’m using a LinearLayout with horizontal orientation which i thought would add a new line when the textviews doesnt fit into the row. And how wrong I was.
Thing is I don’t know how many rows there will be, since it depends on user input. Therefor a GridView doesn’t feels right, since I can’t specify the number of columns. And I don’t know every size of every TextView, which might make it look bad if a TextView is very long and I want 3 TextViews per row.
I’m sure there is a simple solution to this, I just wanna know the best one. Which layout should I use so when I add TextViews to it, so it makes a new row below the first one when it reaches the screen width?
Thanks!
See this:
Here i have taken One TextView and One EditText. Instead of that you can take two TextView or any Number of view you want.
Enjoy. 🙂