问题
I am not sure if this question has been answered or not(I tried looking but couldn't find anything) This is the portion of the layout that I have a question about.
For the selected textview, here is the xml code
My question is why is that textview not taking up the complete width of the row. I am assuming that because I used "match_parent" for the layout_width that the textview should take up the complete width of its parent, which is the TableRow. I tried looking this situation up on the TableLayout API (http://developer.android.com/reference/android/widget/TableLayout.html) but the only instance in which "match_parent" was mentioned was in the situation where you add an element to the table layout without it being in a row, its width will be set to "match_parent". Does this have anything to do with rows/columns and that behavior somehow overwriting "match_parent"?
回答1:
assign
android:layout_weight="1"
to textview
it will occupy entire width
来源:https://stackoverflow.com/questions/26029824/why-does-text-view-not-take-up-the-whole-table-rows-width