Skip to content

Instantly share code, notes, and snippets.

@rspencer01
Last active April 13, 2017 14:39
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 rspencer01/c1964b98f0c60de7c49683a049ed0640 to your computer and use it in GitHub Desktop.
Save rspencer01/c1964b98f0c60de7c49683a049ed0640 to your computer and use it in GitHub Desktop.
Sample Yoga Layout
<?xml version="1.0" encoding="utf-8" ?>
<YogaLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:yoga="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
yoga:yg_alignItems="stretch"
>
<YogaLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/sample_children_background"
yoga:yg_marginHorizontal="10dp"
yoga:yg_marginTop="5dp"
yoga:yg_flexDirection="row"
yoga:yg_alignItems="center"
>
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/ic_launcher"
yoga:yg_flex="0"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/child_1_text"
android:textColor="@color/children_text"
yoga:yg_flex="1"
yoga:yg_marginStart="8dp"
/>
</YogaLayout>
</YogaLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment