其他分享
首页 > 其他分享> > android – 如何在代码中设置视图的布局列(视图在tablerow中)?

android – 如何在代码中设置视图的布局列(视图在tablerow中)?

作者:互联网

我在xml中有一个tablelayout.我还在代码中添加了一些行.如何在代码中设置一些视图的column_layout?

在xml我有:

android:layout_column="3"

如何在代码中实现相同的功能(例如TextView)?

解决方法:

        TextView tv = new TextView(this); 
        tv.setLayoutParams(new TableRow.LayoutParams(3));

标签:tablerow,tablelayout,android
来源: https://codeday.me/bug/20190730/1578372.html