code: @Override
      protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
          super.onMeasure(widthMeasureSpec, heightMeasureSpec);
  
          mWidth = measureWidth(widthMeasureSpec);
          mHeight = measureHeight(heightMeasureSpec);
  
          setMeasuredDimension(mWidth, mHeight);
      }
docs: 设置控件的宽高