Why does text view not take up the whole table row's width?

笑着哭i 提交于 2019-12-13 05:17:01

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!