Skip to content

Instantly share code, notes, and snippets.

@AsheeshSharma
Last active April 1, 2022 09:11
Show Gist options
  • Save AsheeshSharma/1c549aa1d0f2e28497c4a2cc249b2d4b to your computer and use it in GitHub Desktop.
Save AsheeshSharma/1c549aa1d0f2e28497c4a2cc249b2d4b to your computer and use it in GitHub Desktop.
Custom aspect ratio with fixed max height
<AppCompatImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:maxHeight="@dimen/size_12"
android:scaleType="fitXY"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment