为什么relativelayout.layoutParams的width为-1

源码里看下就知道了。。 -1不代表宽度,代表MATCH_PARENT常量的值
public static final int FILL_PARENT = -1;

public static final int MATCH_PARENT = -1;

public static final int WRAP_CONTENT = -2;
原文地址:https://www.cnblogs.com/zhaoyanjun/p/4720546.html