모바일 프로그래밍 4주차

2022. 9. 27. 16:21·학교수업
반응형

Layout은 LinearLayout

orientation을 통하여 vertical인지 horizontal 인지 정함

layout_gravity를 통하여 왼쪽 중간 오른쪽 나눔

 

분할을 위해서는 weight를 이용하여 분할을 한다.

 

렐러티브레이아웃(상대적 레이아웃)

상대적 레이아웃  |  Android 개발자  |  Android Developers

 

버튼에 색을 주는 경우 기존 Button이 아닌 android.widget.Button을 사용해야한다.

 

EditText에서 흰트를 위하여는 Hint를 사용하면 된다.

 

match_parent는 부모를 꽉 채우는 것이며, wrap_content는 내용에 따라서 크기를 변동하는 것이다.

 

모바일 프로그래밍 과제

<?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="vertical"
    tools:context=".MainActivity">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:orientation="horizontal">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="#ff0000">
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="#11FF00">
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="#038AFF">
        </LinearLayout>

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:orientation="vertical"
            >

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:background="#FFEB65">
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:background="#6AFAFF">
            </LinearLayout>

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="#878787">
        </LinearLayout>

    </LinearLayout>

</LinearLayout>
반응형
저작자표시 (새창열림)

'학교수업' 카테고리의 다른 글

컴퓨터그래픽스 5주차  (0) 2022.10.05
컴퓨터 그래픽스 4주차  (0) 2022.09.28
데이터베이스 4주차  (0) 2022.09.27
컴퓨터그래픽스응용 3주차  (0) 2022.09.21
데이터베이스 3주차  (0) 2022.09.20
'학교수업' 카테고리의 다른 글
  • 컴퓨터그래픽스 5주차
  • 컴퓨터 그래픽스 4주차
  • 데이터베이스 4주차
  • 컴퓨터그래픽스응용 3주차
숯불돼지왕갈비
숯불돼지왕갈비
  • 숯불돼지왕갈비
    게임 개발 공부기
    숯불돼지왕갈비
  • 전체
    오늘
    어제
    • 분류 전체보기 (302)
      • 학교수업 (165)
      • 취업강의 (6)
      • C++ (49)
        • 코딩 테스트 (4)
      • Unreal Engine 5 (25)
        • MMORPG 개발 (25)
      • Unreal Engine 4 (44)
        • Omak Project (3)
        • Unreal Engine 4 개발일지 (9)
        • Unreal Engine 4 (32)
      • Unity (1)
        • 개발 일지 (1)
      • 수학 (3)
        • 소프트웨어 공학용 수학 (3)
      • DirectX 11 (4)
      • 게임 디자인 패턴 (2)
      • 포트폴리오 (1)
      • 자격증 (1)
        • 정보처리기사 (0)
        • SQLD (0)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.0
숯불돼지왕갈비
모바일 프로그래밍 4주차
상단으로

티스토리툴바