@Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); //获取SingleTouchView所在父布局的中心点 ViewGroup mViewGroup = (ViewGroup) getParent(); if(null != mViewGroup){ mParentWidth = mViewGroup.getWidth(); mParentHeight = mViewGroup.getHeight(); } }
时间: 2024-10-28 20:35:48