方形view

public class SquareLayout extends LinearLayout{
public SquareLayout(Context context) {
super(context);
}

public SquareLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}

public SquareLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}

@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, widthMeasureSpec);
}

@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, w, oldw, oldh);
}

@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
}
}
posted @ 2016-01-29 14:00  visuals  阅读(186)  评论(0编辑  收藏  举报