首页 > android.support.v7.widget.GridLayout内代码添加textview,v7包下的属性怎么用代码设置

android.support.v7.widget.GridLayout内代码添加textview,v7包下的属性怎么用代码设置

<android.support.v7.widget.GridLayout

        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/commremind_tab"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingRight="10dp"
        app:columnCount="5"
        app:rowCount="5">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text=""
            app:layout_columnWeight="3"
            app:layout_rowWeight="1" />
            

这两个属性怎么用代码设置
app:layout_columnWeight="3"
app:layout_rowWeight="1"


((GridLayout.LayoutParams) this.getLayoutParams()).columnSpec =

GridLayout.spec(GridLayout.UNDEFINED, 3f);
【热门文章】
【热门文章】