Thursday, April 4, 2013

Android-Flow Layout in JAVA


The reason you don't see the third TextView is that your layout has a horizontal orientation and while the first two TextViews fit the screen size the third one is getting pushed outside.


To fix this issue you can do several steps:


1. change your layout orientation to vertical in the XML or the java file, and that way the TextView will appear one after the other vertically.


2. if you want to keep more then one TextView in a row, then you should still set you main layout orientation to vertical, but for each row of TextView's create a new layout with horizontal orientation using code and added the TextView to this layout.



LinearLayout tvRow = new LinearLayout();
tvRow.addView(firstTextView);
tvRow.addView(secondTextView);


Finally add this layout to your main layout:



mailLayout.addView(tvRow);


.

forum.xda-developers.com

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...