Skip to content

Instantly share code, notes, and snippets.

@moagrius
Created July 1, 2016 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moagrius/ad85dafd8d2547d986de17e94b8c5b35 to your computer and use it in GitHub Desktop.
Save moagrius/ad85dafd8d2547d986de17e94b8c5b35 to your computer and use it in GitHub Desktop.
XML use of CenterContainViewGroup
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.michaeldunn.experiments.widgets.CenterContainViewGroup
android:layout_width="match_parent"
android:layout_height="match_parent"
app:natural_height="1080"
app:natural_width="1920">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@drawable/some_image" />
</com.michaeldunn.experiments.widgets.CenterContainViewGroup>
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment