setAspectRatio

open fun setAspectRatio(widthToHeightRatio: Float)

Set aspect ratio for the fragment view.

The dimension (width or height) that is fixed in layout will be kept and the other dimension will be increased or decreased to match the aspect ratio.

Parameters

widthToHeightRatio

the desired aspect ratio