Stefan wrote: > i have a problem with the TableLayout. I want to put 4 buttons in one > TableRow and i set the size. > But the size of the first button is equal to the size of a TextView in > an other TableRow. Why??
TableLayout works like HTML tables -- the column widths are set by their contents. The width of your first column will be the maximum width among all of the first items in each row. The first item in your first row is the TextView, and the first item in the second row is the first Button. Whichever of those is wider (presumably the TextView) will determine the width of the column. Moreover: "The children of a TableRow do not need to specify the layout_width and layout_height attributes in the XML file. TableRow always enforces those values to be respectively FILL_PARENT and WRAP_CONTENT." (from http://developer.android.com/reference/android/widget/TableRow.html) Hence, the smaller widgets in the column will expand to fill the space set aside by the largest widget. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.0 Available! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---