android:shrinkColumns和android:stretchColumns如何工作? [英] How do android:shrinkColumns and android:stretchColumns work?
问题描述
我可以在TableLayout
上设置android:shrinkColumns
和android:stretchColumns
.
例如:
<TableLayout
android:shrinkColumns="2,3"
android:stretchColumns="1,3"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
那么此属性如何影响列?
So how do this properties affects columns?
推荐答案
TableLayout可以通过调用setColumnShrinkable()(xml:android:shrinkColumns) or setColumnStretchable()(xml:android:stretchColumns)
将某些列指定为可收缩或可扩展的.
TableLayout can specify certain columns as shrinkable or stretchable by calling setColumnShrinkable()(xml:android:shrinkColumns) or setColumnStretchable()(xml:android:stretchColumns)
.
如果标记为 可收缩 ,则可以缩小列宽以使表格适合其父对象.如果标记为可拉伸,则其宽度可以扩展以适合任何额外的空间.
If marked as shrinkable, the column width can be shrunk to fit the table into its parent object. If marked as stretchable, it can expand in width to fit any extra space.
表的总宽度由其父容器定义.重要的是要记住,列可以是可收缩的和可拉伸的.
The total width of the table is defined by its parent container. It is important to remember that a column can be both shrinkable and stretchable .
有关详细信息,您可以访问
For details information you may visit
https://developer.android.com/reference/android/widget/TableLayout.html
这篇关于android:shrinkColumns和android:stretchColumns如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!