meong_j
기록하는 습관.
meong_j
전체 방문자
오늘
어제
  • 분류 전체보기 (176)
    • 개인 공부 정리 (0)
    • 서버 운영 (37)
      • Linux (36)
    • Frontend (11)
      • Vue.js (10)
    • Backend (70)
      • Java (4)
      • Python (22)
      • Django (38)
      • Spring (6)
    • Database (5)
      • Oracle (4)
      • MySQL (1)
      • MariaDB (0)
    • Android (14)
      • Kotlin (6)
    • 배포 (9)
      • Docker (8)
      • AWS (1)
    • IT_study (29)
      • Coding test (17)
      • 알고리즘 (5)
      • 스터디 (6)

블로그 메뉴

  • 홈
  • 태그
  • 방명록
  • github

인기 글

반응형

태그

  • 중첩라우트
  • 이차원배열정렬
  • 배포인프라
  • dp #알고리즘
  • Kotlin
  • 코틀린자료형
  • cpu사용률
  • 개발자도서
  • dockersecret
  • 안드로이드adaptor
  • django
  • gabagecollecter
  • Proxy
  • router-link
  • docker
  • DHCP
  • 리눅스인증
  • 리눅스방화벽
  • 테크커리어
  • SASS Variables

최근 댓글

최근 글

250x250
hELLO · Designed By 정상우.
meong_j

기록하는 습관.

Android

[Android] LinearLayout

2021. 12. 5. 23:27
728x90
반응형

LinearLayout 

  • 방향성을 가지고 view 를 배치하는 layout 이다
  • 가로 혹은 세로 방향으로 배치할 수 있으며 한 칸에 하나의 view만 배치할 수 있다

 

LinearLayout의 주요 속성

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    tools:context=".MainActivity">

    <Button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="Button" />

    <Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="Button" />

    <Button
        android:id="@+id/button3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="Button" />

    <Button
        android:id="@+id/button4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="Button" />
</LinearLayout>

  • orientation : 배치되는 모양을 결정한다 (horizontal 좌 -> 우 / vertical 위 -> 아래)
  • weight : LinearLayout 안에 배치되는 View 들의 비율을 설정한다.

 

 

반응형
저작자표시 비영리 변경금지 (새창열림)

'Android' 카테고리의 다른 글

[Android] TableLayout  (0) 2021.12.21
[Android] FrameLayout  (0) 2021.12.06
[Android] View 의 기본 개념  (0) 2021.12.05
안드로이드 동작 원리  (0) 2021.12.05
Android(안드로이드)란?  (0) 2021.12.04
    'Android' 카테고리의 다른 글
    • [Android] TableLayout
    • [Android] FrameLayout
    • [Android] View 의 기본 개념
    • 안드로이드 동작 원리
    meong_j
    meong_j
    #it #개발일기 #개발공부 #개발자 #백앤드 #생각정리 #시간은 실력에 비례한다 #뭐든지 꾸준히 열심히 #오늘의 내가 내일의 나를 만든다

    티스토리툴바