为什么文本视图不会占用整个表行的宽度是多少? [英] Why does text view not take up the whole table row's width?
问题描述
我不知道,如果这个问题已经回答与否(我试着寻找,但没有找到任何东西)
这是我有一个问题关于布局的一部分。
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.
对于选定的TextView,这里是XML code
For the selected textview, here is the xml code
我的问题是,这是为什么TextView中不占行的整个宽度。我假设,因为我使用了match_parent为layout_width该TextView中应承担其母公司,这是的TableRow的完整宽度。我试图寻找这种情况上来就TableLayout API( http://developer.android。 COM /参考/安卓/空间/ TableLayout.html ),但其中match_parent中提到的唯一实例是在您没有它成一排,其宽度将作为一个元素添加到表格的布局情况被设置为match_parent。这是否有什么用行/列和行为在某种程度上改写match_parent?
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"?
推荐答案
分配
android:layout_weight="1"
要的TextView
to textview
它会占据整个宽度
这篇关于为什么文本视图不会占用整个表行的宽度是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!