LinearLayoutDemo5-layout_weight, 상대적인 비율로 크기 조정하기

CODEDRAGON Development/Android

반응형

상대적인 비율로 크기 조정하기

   

   

layout_weight 비율 명시

  • 같은 비율은 0으로 지정하고
  • 크기를 키울것은 1로 지정해서 비율로 크기를 조절할 수 있습니다.

   

   

강의 내용

activity_main.xml

LinearLayout 변경

-android:orientation="vertical"

-Graphical Layout > Form Widgets-Button추가

-Graphical Layout > Text Fields-Plain Text 추가

-Graphical Layout > Form Widgets-Button추가

android:layout_weight ( 0:1:0)

   

   

 

   

출력 결과

비율 미지정

   

비율 지정

   

반응형