- Add as a library project
- Add
xmlns:marijnvdwerf="http://schemas.android.com/apk/res-auto"
to your layout xml - Insert a
<nl.marijnvdwerf.layouts.FixedAspectRatioFrameLayout />
view - Set the aspect ratio by adding a
marijnvdwerf:aspectRatio="1.77"
attribute - Specify in which direction the element should change size by adding
marijnvdwerf:stretchMode="vertical"