Android에서 View, ViewGroup, XML Layout은 사용자 인터페이스(Ui)를 설계하고 구성하는데 사용되는 중요한 개념과 구성 요소이다.
오늘은 이러한 것들에 대해서 정리를 해보자.

View 란?
View는 Android 애플리케이션에서 사용자 인터페이스의 기본 구성 요소이다. 버튼, 텍스트상자, 이미지, 체크박스와 같은 사용자가 보는 Ui 요소는 모두 View의 하위 클래스이다. View는 사용자 입력을 처리하고 화면에 그래픽 요소를 그릴 수 있다!
View 객체를 일반적으로 위젯 이라고 부르며, 위에서도 언급했듯 Button 또는 TextView와 같은 여러 서브 클래스 중 하나 일 수 있다.

ViewGroup 이란?
ViewGroup을 일반적으로는 레이아웃 이라고 부르며, LinearLayout 또는 ConstraintLayout과 같은 다양한 레이아웃 구조를 제공하는 여러 유형중 하나이다.
ViewGroup은 View의 하위클래스이며, 다른 View 요소들을 포함하고 그룹화하는데 사용한다.
ViewGroup은 포함된 View 요소들을 배치하고 정렬하는 데 사용된다.

XML Layout이란?
XML은 Android 애플리케이션의 사용자 인터페이스를 정의하기 위해 사용되는 마크업 언어이다.
XML 레이아웃 파일은 애플리케이션의 레이아웃 구조를 설명하며, View 및 ViewGroup 요소를 구성하고 배치하는데 사용된다.
XML 레이아웃 파일은 리소스 디렉터리(res/layout)에 저장되며, 애플리케이션 코드에서 인플레이트(inflate)하여 실제 Ui를 생성한다.
간단한 예제 ( LinearLayout을 사용하여 버튼을 수직으로 배치하는 간단한 XML 레이아웃 예제)
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="버튼 1" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="버튼 2" />
</LinearLayout>
참고
View, ViewGroup, XML Layout 이란?
View란? View란 기본적으로 화면에 보이는 것들을 말하는데 흔히 Widget(Control)이라 불리는 UI 구성 요소들이 View이다. 위의 설명은 구글에서 제공하는 View에 대한 설명인데 직접적인 자식으로 ImageView
ju-hy.tistory.com
https://developer.android.com/guide/topics/ui/declaring-layout?hl=ko
레이아웃 | Android 개발자 | Android Developers
레이아웃은 활동 또는 앱 위젯의 UI와 같은 사용자 인터페이스의 시각적 구조를 정의합니다. 두 가지 방법으로 레이아웃을 선언할 수 있습니다. Android 프레임워크를 통해 이 두 가지 메서드의 하
developer.android.com
'Android > Study' 카테고리의 다른 글
[Android] 안드로이드 앱 개발의 특징 (0) | 2023.09.19 |
---|---|
[Android] ConstraintLayout 이란 (0) | 2023.09.11 |
[Android] Glide 간단 정리 (0) | 2023.07.28 |
[Android] MVI 패턴이란? (0) | 2023.05.04 |
[Android] 의존성 주입(Dependency Injection) (0) | 2023.04.27 |
Android에서 View, ViewGroup, XML Layout은 사용자 인터페이스(Ui)를 설계하고 구성하는데 사용되는 중요한 개념과 구성 요소이다.
오늘은 이러한 것들에 대해서 정리를 해보자.

View 란?
View는 Android 애플리케이션에서 사용자 인터페이스의 기본 구성 요소이다. 버튼, 텍스트상자, 이미지, 체크박스와 같은 사용자가 보는 Ui 요소는 모두 View의 하위 클래스이다. View는 사용자 입력을 처리하고 화면에 그래픽 요소를 그릴 수 있다!
View 객체를 일반적으로 위젯 이라고 부르며, 위에서도 언급했듯 Button 또는 TextView와 같은 여러 서브 클래스 중 하나 일 수 있다.

ViewGroup 이란?
ViewGroup을 일반적으로는 레이아웃 이라고 부르며, LinearLayout 또는 ConstraintLayout과 같은 다양한 레이아웃 구조를 제공하는 여러 유형중 하나이다.
ViewGroup은 View의 하위클래스이며, 다른 View 요소들을 포함하고 그룹화하는데 사용한다.
ViewGroup은 포함된 View 요소들을 배치하고 정렬하는 데 사용된다.

XML Layout이란?
XML은 Android 애플리케이션의 사용자 인터페이스를 정의하기 위해 사용되는 마크업 언어이다.
XML 레이아웃 파일은 애플리케이션의 레이아웃 구조를 설명하며, View 및 ViewGroup 요소를 구성하고 배치하는데 사용된다.
XML 레이아웃 파일은 리소스 디렉터리(res/layout)에 저장되며, 애플리케이션 코드에서 인플레이트(inflate)하여 실제 Ui를 생성한다.
간단한 예제 ( LinearLayout을 사용하여 버튼을 수직으로 배치하는 간단한 XML 레이아웃 예제)
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="버튼 1" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="버튼 2" />
</LinearLayout>
참고
View, ViewGroup, XML Layout 이란?
View란? View란 기본적으로 화면에 보이는 것들을 말하는데 흔히 Widget(Control)이라 불리는 UI 구성 요소들이 View이다. 위의 설명은 구글에서 제공하는 View에 대한 설명인데 직접적인 자식으로 ImageView
ju-hy.tistory.com
https://developer.android.com/guide/topics/ui/declaring-layout?hl=ko
레이아웃 | Android 개발자 | Android Developers
레이아웃은 활동 또는 앱 위젯의 UI와 같은 사용자 인터페이스의 시각적 구조를 정의합니다. 두 가지 방법으로 레이아웃을 선언할 수 있습니다. Android 프레임워크를 통해 이 두 가지 메서드의 하
developer.android.com
'Android > Study' 카테고리의 다른 글
[Android] 안드로이드 앱 개발의 특징 (0) | 2023.09.19 |
---|---|
[Android] ConstraintLayout 이란 (0) | 2023.09.11 |
[Android] Glide 간단 정리 (0) | 2023.07.28 |
[Android] MVI 패턴이란? (0) | 2023.05.04 |
[Android] 의존성 주입(Dependency Injection) (0) | 2023.04.27 |