LinearLayout源码中children的虚数是什么意思

what's the meaning of virtual number of children in LinearLayout source code

LinearLayout的方法--getVirtualChildCount()就是return方法 ViewGroup 的 getChildCount(),注意:如果布局可以容纳虚拟 children,则此数字可能与 children 的实际数量不同。那么什么是“虚拟children”

它们被 TableRow/TableLayout 使用 according to this post:

These methods are used by TableRow/TableLayout. You don't need to worry about them, they are only meant for internal use.

我已经对其进行了一些搜索activity。

方法 getChildCount() 适用于表格结构。

TableRow extends LinearLayout

并且该方法在 TableRow 中被覆盖。

@Override
public int getVirtualChildCount() {
    if (mColumnToChildIndex == null) {
        mapIndexAndColumns();
    }
    return mNumColumns;
}

TableRow 中的方法 returns 子项的数量,包括行内用于填充目的的虚拟子项。

所以我可以说,它基本上是该行中的列数。