Is it correct to work with the width and height parameters after making the setMeasuredDimension call?

30 Views Asked by At

I created a custom view in which I want to draw a series of squares, the side of the square depends on the dimensions that are assigned to the view, so in my method onMeasure() after checking mode and size, I call setMeasuredDimension (width, height). Now it is correct to perform operations after setMeasuredDimension like

protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    /*******/
    setMeasuredDimension(width,height);
    squareSize = width / rows;
}
0

There are 0 best solutions below