JayJona
JayJona

Reputation: 502

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

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;
}

Upvotes: 0

Views: 28

Answers (0)

Related Questions