Skip to content

Instantly share code, notes, and snippets.

@agiletalk
Created April 12, 2011 16:41
Show Gist options
  • Save agiletalk/915877 to your computer and use it in GitHub Desktop.
Save agiletalk/915877 to your computer and use it in GitHub Desktop.
[예제] layout_gravity
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="정렬 테스트"
android:textSize="30px"
android:textColor="#00ff00"
android:background="#ff0000"
android:layout_gravity="center"
/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="정렬 테스트"
android:textSize="30px"
android:textColor="#00ff00"
android:background="#ff0000"
/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="정렬 테스트"
android:textSize="30px"
android:textColor="#00ff00"
android:background="#ff0000"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="버튼이다."
/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="200px"
android:layout_height="100px"
android:text="정렬 테스트"
android:textSize="30px"
android:textColor="#00ff00"
android:background="#ff0000"
android:layout_gravity="center_horizontal"
android:gravity="right|bottom"
/>
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment