Skip to content

Instantly share code, notes, and snippets.

@MadinaB
Last active October 28, 2017 11:41
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 MadinaB/9886dfb2ac0490f95d56b1e2893a0603 to your computer and use it in GitHub Desktop.
Save MadinaB/9886dfb2ac0490f95d56b1e2893a0603 to your computer and use it in GitHub Desktop.
Android Cheat Sheet:
https://drive.google.com/file/d/0B5XIkMkayHgRMVljUVIyZzNmQUU/view
Views:VirtualLayout
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/natalie_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@id/ben_text_view"
android:textSize="24sp"
android:text="Natalie" />
<TextView
android:id="@+id/jennie_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:textSize="24sp"
android:text="Jennie" />
<TextView
android:id="@+id/omoju_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_above="@id/jennie_text_view"
android:textSize="24sp"
android:text="Omoju" />
<TextView
android:id="@+id/ben_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:textSize="24sp"
android:text="Ben" />
</RelativeLayout>
Views:LinearLayout
<LinearLayout
android:orientation = "vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<TextView
android:text="hi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_weight="1"
/>
/>
Views: TextView:
android:textAllCaps="true"
Views: ImageView:
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment