ºÇ½ª¹¹¿·¡§ t_yokky2002 2011ǯ10·î16Æü(Æü) 22:32:29ÍúÎò
²èÌ̾å¤Ë¡¢¥Ó¥å¡¼¡Ê¥Æ¥¥¹¥È¥Ó¥å¡¼¡¢¥é¥¸¥ª¥Ü¥¿¥ó¤Ê¤É¡Ë¤òÇÛÃÖ¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤Þ¤¹¡£ ¤Ò¤È¤Ä¤Î¥Ó¥å¡¼¥°¥ë¡¼¥×¤ÎÃæ¤Ë¤Ï¡¢Ê£¿ô¤Î¥Ó¥å¡¼¤Þ¤¿¤Ï¥Ó¥å¡¼¥°¥ë¡¼¥×¤òÇÛÃ֤Ǥ Á´ÂΤȤ·¤Æ³¬Áع½Â¤¡Ê¥Ä¥ê¡¼¹½Â¤¡Ë¤ò¤È¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ ¤³¤ì¤Ë¤è¤Ã¤Æ¡¢Ê£»¨¤Ê¥ì¥¤¥¢¥¦¥È¤òºîÀ®¤¹¤ë¤³¤È¤¬²Äǽ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
̾¾Î | ¥¯¥é¥¹ | ³µÍ× |
---|---|---|
¥ê¥Ë¥¢¥ì¥¤¥¢¥¦¥È | LinearLayout | ¿åÊ¿Êý¸þ¤Þ¤¿¤Ï¿âľÊý¸þ¤Ë¥Ó¥å¡¼¤òÇÛÃÖ¤¹¤ë¡£ |
ÁêÂХ쥤¥¢¥¦¥È | RelativeLayout | ¤³¤Î¥Ó¥å¡¼Æ±»Î¤ÎÁêÂдط¸¤ä¡¢¿Æ¤Î¥Ó¥å¡¼¤ÎÁêÂдط¸¤ÇÇÛÃÖ¤¹¤ë¡£ |
¥Õ¥ì¡¼¥à¥ì¥¤¥¢¥¦¥È | FrameLayout | º¸¾å¤ò´ðÅÀ¤Ë¡¢¤Ò¤È¤Ä¤Î¥Ó¥å¡¼¤òÇÛÃÖ¤¹¤ë¡£Ê£¿ô¤Î¥Ó¥å¡¼¤ò½Å¤Í¹ç¤ï¤»¤ë¤³¤È¤â²Äǽ¡£ |
¥Æ¡¼¥Ö¥ë¥ì¥¤¥¢¥¦¥È | TableLayout | ¥Æ¡¼¥Ö¥ë·Á¼°¤Ë¥Ó¥å¡¼¤òÇÛÃÖ¤¹¤ë¡£Ä̾ÆâÉô¤Ë¥Æ¡¼¥Ö¥ë¹Ô¥ì¥¤¥¢¥¦¥È¤ò»ØÄꤹ¤ë¡£ |
°ÀÃÍ | °ÕÌ£ |
---|---|
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 | ¤³¤Î°À¤Ë»ØÄꤷ¤¿¥¤¥á¡¼¥¸¤ÇºÇÁ°Ì̤ò¿¤¤È碌¤ë¤è¤¦¤ËÉÁ²è¤¹¤ë |
foregroudGravity | forground¤Ë»ØÄꤷ¤¿¥¤¥á¡¼¥¸¤Î½ÅÎÏÊý¸þ¤ò»ØÄꤹ¤ë¡£»ØÄê¤Ç¤¤ëÃͤϡ¢LinearLayout¤ÈƱÍÍ |
mesureAllChildren | ¤¹¤Ù¤Æ¤Î¥Ó¥å¡¼¤ÎÀ£Ë¡¤ò·×¬¤¹¤ë¾ì¹ç¤Ï¡¢true¤ò»ØÄꤹ¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ï¡¢false |
<?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>
¥³¥á¥ó¥È¤ò¤«¤¯