想让子view可以设置margin,写继承ViewGroup的自定义View时为啥要重写generateLayoutParams(AttributeSet attrs)
转自:https://www.jianshu.com/p/99c27e2db843重写generateLayoutParams()方法:LayoutParams是ViewGroup的一个内部类,它的构造方法:publicLayoutParams(Contextc,AttributeSetattrs){TypedArraya=c.obtainStyledAttributes(attrs,R.styl