Inherit ViewGroup to learn onMeasure and onLayout
When inheriting the ViewGroup class, you need to override two methods, onMeasure and onLayout.1, call setMeasuredDimension method void android. in method onMeasure. view. View. setMeasuredDimension(int measuredWidth, int measuredHeight)In onMeasure(int, int), you must call setMeasuredDimension(int width, int height) to store the measured width ...
Added by klik on Wed, 15 Dec 2021 12:23:46 +0200