Android¥¢¥×¥ê¤ò³«È¯¤¹¤ë¤¿¤á¤Î´ðÁäò¤Þ¤È¤á¤Æ¤¢¤ê¤Þ¤¹¡£


¥Ó¥å¡¼¥°¥ë¡¼¥×¤È¤Ï¡©

²èÌ̾å¤Ë¡¢¥Ó¥å¡¼¡Ê¥Æ¥­¥¹¥È¥Ó¥å¡¼¡¢¥é¥¸¥ª¥Ü¥¿¥ó¤Ê¤É¡Ë¤òÇÛÃÖ¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤Þ¤¹¡£
¤Ò¤È¤Ä¤Î¥Ó¥å¡¼¥°¥ë¡¼¥×¤ÎÃæ¤Ë¤Ï¡¢Ê£¿ô¤Î¥Ó¥å¡¼¤Þ¤¿¤Ï¥Ó¥å¡¼¥°¥ë¡¼¥×¤òÇÛÃ֤Ǥ­
Á´ÂΤȤ·¤Æ³¬Áع½Â¤¡Ê¥Ä¥ê¡¼¹½Â¤¡Ë¤ò¤È¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
¤³¤ì¤Ë¤è¤Ã¤Æ¡¢Ê£»¨¤Ê¥ì¥¤¥¢¥¦¥È¤òºîÀ®¤¹¤ë¤³¤È¤¬²Äǽ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£

ÂåɽŪ¤Ê¥Ó¥å¡¼¥°¥ë¡¼¥×

̾¾Î¥¯¥é¥¹³µÍ×
¥ê¥Ë¥¢¥ì¥¤¥¢¥¦¥ÈLinearLayout¿åÊ¿Êý¸þ¤Þ¤¿¤Ï¿âľÊý¸þ¤Ë¥Ó¥å¡¼¤òÇÛÃÖ¤¹¤ë¡£
ÁêÂХ쥤¥¢¥¦¥ÈRelativeLayout¤³¤Î¥Ó¥å¡¼Æ±»Î¤ÎÁêÂдط¸¤ä¡¢¿Æ¤Î¥Ó¥å¡¼¤ÎÁêÂдط¸¤ÇÇÛÃÖ¤¹¤ë¡£
¥Õ¥ì¡¼¥à¥ì¥¤¥¢¥¦¥ÈFrameLayoutº¸¾å¤ò´ðÅÀ¤Ë¡¢¤Ò¤È¤Ä¤Î¥Ó¥å¡¼¤òÇÛÃÖ¤¹¤ë¡£Ê£¿ô¤Î¥Ó¥å¡¼¤ò½Å¤Í¹ç¤ï¤»¤ë¤³¤È¤â²Äǽ¡£
¥Æ¡¼¥Ö¥ë¥ì¥¤¥¢¥¦¥ÈTableLayout¥Æ¡¼¥Ö¥ë·Á¼°¤Ë¥Ó¥å¡¼¤òÇÛÃÖ¤¹¤ë¡£Ä̾ÆâÉô¤Ë¥Æ¡¼¥Ö¥ë¹Ô¥ì¥¤¥¢¥¦¥È¤ò»ØÄꤹ¤ë¡£

¥ê¥Ë¥¢¥ì¥¤¥¢¥¦¥È

¥ª¥ê¥¨¥ó¥Æ¡¼¥·¥ç¥ó°À­
°À­ÃÍ°ÕÌ£
horizontalÍ×ÁǤò¿åÊ¿Êý¸þ¤ËÄɲ乤ë
verticalÍ×ÁǤò¿âľÊýË¡¤ËÄɲ乤ë
¥°¥é¥Ó¥Æ¥£Â°À­
°À­ÃÍ°ÕÌ£
top¾å´ó¤»¤Ë¤¹¤ë
bottom²¼´ó¤»¤Ë¤¹¤ë
leftº¸´ó¤»¤Ë¤¹¤ë
right±¦´ó¤»¤Ë¤¹¤ë
center_vertical¿âľÊý¸þ¤ÎÃæ±û¤ËÇÛÃÖ¤¹¤ë
center_horizontal¿åÊ¿Êý¸þ¤ÎÃæ±û¤ËÇÛÃÖ¤¹¤ë
fill_vertical¿âľÊý¸þ¤ò¥³¥ó¥Æ¥Ê¤Î¥µ¥¤¥º¤Ë³ÈÂ礷¤ÆÇÛÃÖ¤¹¤ë
fill_horizontal¿åÊ¿Êý¸þ¤ò¥³¥ó¥Æ¥Ê¤Î¥µ¥¤¥º¤Ë³ÈÂ礷¤ÆÇÛÃÖ¤¹¤ë
center¿åÊ¿Êý¸þ¤È¿âľÊý¸þ¤ÎÃæ±û¤ËÇÛÃÖ¤¹¤ë
fill¿åÊ¿Êý¸þ¤È¿âľÊý¸þ¤ò¥³¥ó¥Æ¥Ê¤Î¥µ¥¤¥º¤Ë³ÈÂ礷¤ÆÇÛÃÖ¤¹¤ë
¢¨right|bottom¤Î¤è¤¦¤Ë¡¢2¤Ä¤Î»ØÄê¤ò¡Ö|¡×¤Ç¤Ä¤Ê¤°»ö¤â²Äǽ
¥µ¥ó¥×¥ë

<?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:background="@android:color/white">
  <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:textSize="20dip"
    android:paddingBottom="5dip"
    android:textColor="@android:color/black"
    android:text=" LinearLayout¥µ¥ó¥×¥ë" />
  <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
    <Button
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Button1" />
    <Button
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Button2" />
  </LinearLayout>
  <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
    <Button
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Button3"
      android:layout_weight="1" />
    <Button
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Button4"
      android:layout_weight="1" />
    <Button
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Button5"
      android:layout_weight="1" />
  </LinearLayout>
  <Button
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Button6" />
  <Button
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:text="Button7" />
</LinearLayout>

ÁêÂХ쥤¥¢¥¦¥È

¥ì¥¤¥¢¥¦¥È°À­
°À­°ÕÌ£
layout_above»ØÄꤷ¤¿¥Ó¥å¡¼¤Î¾å¤ËÇÛÃÖ¤¹¤ë
layout_below»ØÄꤷ¤¿¥Ó¥å¡¼¤Î²¼¤ËÇÛÃÖ¤¹¤ë
layout_toLeftOf»ØÄꤷ¤¿¥Ó¥å¡¼¤Îº¸¤ËÇÛÃÖ¤¹¤ë
layout_toRightOf»ØÄꤷ¤¿¥Ó¥å¡¼¤Î±¦¤ËÇÛÃÖ¤¹¤ë
layout_alignBaseline»ØÄꤷ¤¿¥Ó¥å¡¼¤Î¥Ù¡¼¥¹¥é¥¤¥ó¤Ë¹ç¤ï¤»¤ÆÇÛÃÖ¤¹¤ë
¥µ¥ó¥×¥ë

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
	android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@android:color/darker_gray"
	android:padding="20dip">
	<Button
	    android:id="@+id/center"
	    android:layout_width="50dip"
		android:layout_height="50dip"
		android:layout_centerInParent="true"
		android:text="¡ù" />
	<Button
	    android:id="@+id/avobe"
	    android:layout_width="50dip"
		android:layout_height="50dip"
		android:layout_above="@+id/center"
		android:layout_alignLeft="@+id/center"
		android:text="¢¬" />
	<Button
	    android:id="@+id/below"
	    android:layout_width="50dip"
		android:layout_height="50dip"
		android:layout_below="@+id/center"
		android:layout_alignLeft="@+id/center"
		android:text="¢­" />
	<Button
	    android:id="@+id/left"
	    android:layout_width="50dip"
		android:layout_height="50dip"
		android:layout_toLeftOf="@+id/center"
		android:layout_alignTop="@+id/center"
		android:text="¢«" />
	<Button
	    android:id="@+id/right"
	    android:layout_width="50dip"
		android:layout_height="50dip"
		android:layout_toRightOf="@+id/center"
		android:layout_alignTop="@+id/center"
		android:text="¢ª" />
</RelativeLayout>

¥Õ¥ì¡¼¥à¥ì¥¤¥¢¥¦¥È

¤³¤Î¥ì¥¤¥¢¥¦¥È¤Ï¡¢¥Ó¥å¡¼¤ò¤Ò¤È¤Ä¤À¤±ÇÛÃÖ¤¹¤ë¤³¤È¤òÌÜŪ¤ËÀ߷פµ¤ì¤¿¡¢¤â¤Ã¤È¤â¥·¥ó¥×¥ë¤Ê¥ì¥¤¥¢¥¦¥È¤Ç¤¹¡£
ÇÛÃÖ¤µ¤ì¤¿¥Ó¥å¡¼¤Ï¡¢Ä̾ï°ìÈÖº¸¾å¤ò´ðÅÀ¤ËÇÛÃÖ¤µ¤ì¤Þ¤¹¡£°ìÈÖº¸¾å¤È¤¤¤¦¤Î¤Ï¡¢¥Ó¥å¡¼¤Î°ÌÃÖ¤¬(0, 0)¤ËÀßÄꤵ¤ì¤ë¤³¤È¤ÈƱµÁ¤Ç¤¹¡£
Ê£¿ô¤Î¥Ó¥å¡¼¤òÇÛÃÖ¤·¤¿¾ì¹ç¡¢·ë²ÌŪ¤ËºÇ¸å¤ËÇÛÃÖ¤·¤¿¥Ó¥å¡¼¤¬ºÇÁ°Ì̤ËÉÁ²è¤µ¤ì¤¿¾õÂ֤ˤʤê¤Þ¤¹¡£
¥ì¥¤¥¢¥¦¥È°À­
°À­°ÕÌ£
forground¤³¤Î°À­¤Ë»ØÄꤷ¤¿¥¤¥á¡¼¥¸¤ÇºÇÁ°Ì̤ò¿¤¤È碌¤ë¤è¤¦¤ËÉÁ²è¤¹¤ë
foregroudGravityforground¤Ë»ØÄꤷ¤¿¥¤¥á¡¼¥¸¤Î½ÅÎÏÊý¸þ¤ò»ØÄꤹ¤ë¡£»ØÄê¤Ç¤­¤ëÃͤϡ¢LinearLayout¤ÈƱÍÍ
mesureAllChildren¤¹¤Ù¤Æ¤Î¥Ó¥å¡¼¤ÎÀ£Ë¡¤ò·×¬¤¹¤ë¾ì¹ç¤Ï¡¢true¤ò»ØÄꤹ¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ï¡¢false
llayout_gravity|¥Ó¥å¡¼¤Î½ÅÎÏÊý¸þ¤ò»ØÄꤹ¤ë¡£LinearLayout¤ÈƱÍÍ|
¥µ¥ó¥×¥ë

<?xml version="1.0" encoding="UTF-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
	android:id="@+id/layout"
	android:layout_width="fill_parent"
	android:layout_height="fill_parent"
	android:background="@android:color/white">
	<TextView
	   android:id="@+id/first"
	   android:layout_width="fill_parent"
	   android:layout_height="fill_parent"
	   android:textColor="@android:color/white"
	   android:background="@android:color/darker_gray"
	   android:textSize="50sp"
	   android:gravity="center_horizontal"
	   android:text="1" />
	<TextView
	   android:id="@+id/sedond"
	   android:layout_width="200dip"
	   android:layout_height="200dip"
	   android:background="#aa0000"
	   android:layout_gravity="center"
	   android:gravity="center"
	   android:textSize="50sp"
	   android:textColor="@android:color/white"
	   android:text="2" />
</FrameLayout>

¥Æ¡¼¥Ö¥ë¥ì¥¤¥¢¥¦¥È

ɽ·Á¼°¤Çɽ¸½¤·¤¿¾ì¹ç¤ËÊØÍø¤Ê¥ì¥¤¥¢¥¦¥È¤Ç¤¹¡£
£±¹Ô¤òɽ¤¹TableRow¥ª¥Ö¥¸¥§¥¯¥È¤Î¥ê¥¹¥È¤Ç¹½À®¤µ¤ì¤Þ¤¹¡£
ɽ¤ÎÎó¿ô¤Ï¡¢¤½¤ÎTableRow¥ª¥Ö¥¸¥§¥¯¥È¤Î¤Ê¤«¤Ç°ìÈÖ¿¤¤¥»¥ë¿ô¤¬¥«¥é¥à¿ô¤È¤·¤ÆºÎÍѤµ¤ì¤Þ¤¹¡£
¥ì¥¤¥¢¥¦¥È°À­
°À­°ÕÌ£
collapseColumns»ØÄꤷ¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹¤ËÂбþ¤¹¤ë¥«¥é¥à¤òÈóɽ¼¨¤Ë¤¹¤ë
shrinkColumns»ØÄꤷ¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹¤ËÂФ¹¤ë¥«¥é¥à¤ò²Äǽ¤Ê¸Â¤ê½Ì¤á¤ë
stretchColumns»ØÄꤷ¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹¤ËÂФ¹¤ë¥«¥é¥à¤ò²Äǽ¤Ê¸Â¤ê¿­¤Ð¤¹
layout_column¥Æ¡¼¥Ö¥ë¤ÎÎó¿ô¤è¤ê¤â¾¯¤Ê¤¤¥»¥ë¤òÀßÄꤷ¤¿¾ì¹ç¡¢¤½¤Î¥»¥ë¤ò²¿ÈÖÌܤ«¤éɽ¼¨¤¹¤ë¤Î¤«»ØÄꤹ¤ë
layout_span¥»¥ë¤ò·ë¹ç¤¹¤ë¡£HTML¥¿¥°¤Îcolspan°À­¤ÈƱµÁ
¥µ¥ó¥×¥ë

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" 
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="@android:color/white"
  android:shrinkColumns="2"
  android:stretchColumns="0,1">
  <TableRow
    android:layout_width="fill_parent"
    android:paddingTop="10dip"
    android:paddingBottom="10dip"
    android:background="#78bc40">
    <TextView
        android:text="ÁªÂò"
        android:gravity="center"
        android:textColor="@android:color/white" />
    <TextView
        android:text="¾¦ÉÊ̾"
        android:gravity="center"
        android:textColor="@android:color/white" />
    <TextView
        android:text="¿ôÎÌ"
        android:gravity="center"
        android:textColor="@android:color/white" />
    </TableRow>
  <TableRow>
    <CheckBox
        android:background="#e0ffe0" />
    <TextView
        android:textColor="@android:color/black"
        android:text="¥·¥ã¡¼¥× AQUOS E9¥é¥¤¥ó 32V·¿ " />
    <EditText
        android:layout_width="40dip"
        android:layout_height="40dip"
        android:numeric="integer"
        android:singleLine="true"
        android:text="3"/>
  </TableRow>
  <TableRow>
    <CheckBox
        android:background="#e0ffe0" />
    <TextView
        android:textColor="@android:color/black"
        android:text="Åì¼Ç REGZA 32V·¿ 32A1L" />
    <EditText
        android:layout_width="40dip"
        android:layout_height="40dip"
        android:numeric="integer"
        android:singleLine="true"
        android:text="1"/>
  </TableRow>
  <TableRow>
    <CheckBox
        android:background="#e0ffe0" />
    <TextView 
        android:textColor="@android:color/black"
        android:text="SONY BRAVIA CX400¥·¥ê¡¼¥º 32V·¿ " />
    <EditText
        android:layout_width="40dip"
        android:layout_height="40dip"
        android:numeric="integer"
        android:singleLine="true"
        android:text="20" />
  </TableRow>
  <TableRow>
    <TextView 
        android:layout_column="1"
        android:gravity="center"
        android:layout_marginTop="80dip"
        android:layout_marginBottom="80dip"
        android:textColor="@android:color/darker_gray"
        android:text="¡¦¡¦¡¦¡¦¡¦ Ãæά ¡¦¡¦¡¦¡¦¡¦ " />
  </TableRow>
  <TableRow>
    <CheckBox
        android:background="#e0ffe0" />
    <TextView
        android:textColor="@android:color/black"
        android:text="¥·¥ã¡¼¥× LED AQUOS V¥·¥ê¡¼¥º" />
    <EditText
        android:layout_width="40dip"
        android:layout_height="40dip"
        android:numeric="integer"
        android:singleLine="true"
        android:text="" />
  </TableRow>
</TableLayout>

¥³¥á¥ó¥È¤ò¤«¤¯


¡Öhttp://¡×¤ò´Þ¤àÅê¹Æ¤Ï¶Ø»ß¤µ¤ì¤Æ¤¤¤Þ¤¹¡£

ÍøÍѵ¬Ìó¤ò¤´³Îǧ¤Î¤¦¤¨¤´µ­Æþ²¼¤µ¤¤

´ÉÍý¿Í/Éû´ÉÍý¿Í¤Î¤ßÊÔ½¸¤Ç¤­¤Þ¤¹