编程语言
首页 > 编程语言> > 在Android中以编程方式实现android:stretchColumns =“*”

在Android中以编程方式实现android:stretchColumns =“*”

作者:互联网

我正在开发一个在TableLayout中实现上述属性的应用程序.

我想知道有谁可以帮助我并告诉我如何以编程方式而不是在布局文件中这样做?

解决方法:

Android文档中查看setColumnStretchable (int columnIndex, boolean isStretchable).

Makes the given column stretchable or not. When stretchable, a column
takes up as much as available space as possible in its row. Calling
this method requests a layout operation.

setStretchAllColumns (boolean stretchAllColumns)

Convenience method to mark all columns as stretchable.

标签:tablelayout,android,android-layout,android-tablelayout
来源: https://codeday.me/bug/20190726/1540381.html