728x90

 리니어 레이아웃 (LinearLayout )

박스모델

한쪽 방향으로 차례대로 뷰를 추가하며 화면을 구성함 

 

android:orientation="vertical"
하위 뷰들을 수직방향으로 배치

android:orientation="horizontal"
/하위 뷰들을 수평방향으로 배치

 

match_parent

부모 레이아웃 길이에 맞춰짐  

 

wrap_content 

입력할 글자 혹은 이미지 크기에 맞춰짐

 

android:background="#000000"

background color변경

 

android:clickable="false"

클릭불가

 

android:rotation="45"

45도만큼 기울임

 

android:enabled="false"

비활성화

 


 

예제풀어보기 

 

 

풀이


<Button
    android:id="@+id/btn1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="20dp"
    android:background="#4CAF50"
    android:text="버튼1" />

<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="아래에 이름을 입력 :"
    android:layout_margin="20dp"
    />
<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="이건에디트뷰입니다"
    android:background="#03A9F4"
    android:layout_margin="20dp"/>

<Button
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:text="비활성화 버튼"
    android:enabled="false"
    android:layout_margin="20dp"

   />

 

728x90
  • 네이버 블러그 공유하기
  • 네이버 밴드에 공유하기
  • 페이스북 공유하기
  • 카카오스토리 공유하기