Android set height and width of Custom view programmatically November 13, 2022 by Tarik You can set height and width like this: myGraphView.setLayoutParams(new LayoutParams(width, height));