Getting end position of the textview and imageview with respect to top of the screen

前端 未结 2 1275
有刺的猬
有刺的猬 2021-01-17 00:19

I have a bitmap and below it is a time line.

As an example consider the right side layout of the FIGURE.

All the bottom timelines (1, 2, 3...) are in the sam

2条回答
  •  温柔的废话
    2021-01-17 00:45

    Hope this helps

    @Override

    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec);

    int parentWidth = MeasureSpec.getSize(widthMeasureSpec);
    int parentHeight = MeasureSpec.getSize(heightMeasureSpec);
    this.setMeasuredDimension(
            parentWidth / 2, parentHeight);
    

    }

提交回复
热议问题