Linear Layout

  Linear Layout은 Box model이며 widgets과 child containers의 배치를 정의한다.
  Linear Layout Control을 위해서 다음 5가지 설정을 지원한다.

     
    • orientation,
    • fill model,
    • weight,
    • gravity
    • padding


1. android:orientation

    Param : vertical, horizontal

    "vertical" : 세로로 배치
    "horizontal" : 가로로 배치


2. android:layout_width, android:layout_height

    Param : fill_parent, wrap_content, (예) 125 px

    "fill_parent" : 가능한 영역을 전부 할당하여 표시
    "wrap_content" : 필요한 만큼의 영역만 할당하여 표시
    "-- px" : 예를들어 "125 px" 125 픽셀만큼만 할당하여 표시

3. android:layout_weight

    Param : 정수 값.

    "1", "2"...: 전체 비율에서 설정한 값만큼의 비율로 할당

4. android:layout_gravity

    Param : fill, top, bottom, center, left, right, center_vertical, fill_vertical, center_horizontal, fill_horizontal, dip_vertical, dip_horizontal

    : 정렬 방식을 지정한다.

5. android:padding

    Param : 픽셀 값.

    : widget에 padding을 지정하여 간격을 띄운다.

'old > XML Attr' 카테고리의 다른 글

XML Attributes_Animation  (0) 2010.02.22
XML Attributes_TextView  (0) 2010.02.22
Posted by jazzlife
,