80,348
社区成员
发帖
与我相关
我的任务
分享
protected void onMesure(int wms,int hms){
// WMS 是 widthMeasureSpec 其他同理
int selfWMode = MeasureSpec.getMode(wms);
int selfWSize = MeasureSpec.getSize(wms);
int usedWidth = 0;
for(int i = 0;i < getChildCount();i++){
View childView = getChildAt(i);
int childWMS = 0;
int childHMS = 0;
LayoutParams lp = childView.getLayoutParams();
switch(lp.width){
case MATCH_PARENT:
if(selfWMode == EXACTLY || selfWMode == AT_MOST){
childWMS = ______________________________;
}
break;
}
}
}
if (lp.width == LayoutParams.MATCH_PARENT) {
final int width = Math.max(0, getMeasuredWidth()
- getPaddingLeftWithForeground() - getPaddingRightWithForeground()
- lp.leftMargin - lp.rightMargin);
childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(
width, MeasureSpec.EXACTLY);
public static void main(String[] args) {
System.out.println(_________);
}
请问println里面该填什么?