Frame Layout - 여러 개의 뷰를 중첩으로 배치하고 그중 하나를 레이아웃의 전면에 표시할 때 사용하는 레이아웃
액자로 생각하면 쉬움, 큰 사진 앞에 작은 사진을 넣는것처럼 생각하면 됨
---------------------
activity_main.xml
<?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">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
android:src="@drawable/ic_launcher_foreground"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textSize="34sp"
android:text="안녕하세요"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:layout_gravity="bottom"
android:textSize="48sp"
android:text="khon"/>
</FrameLayout>
</LinearLayout>
'안드로이드 앱 만들기' 카테고리의 다른 글
Fragment끼리 데이터 전송 (0) | 2020.09.22 |
---|---|
Card View (0) | 2020.09.21 |
Table Layout (0) | 2020.09.15 |
Check Box (옵션 선택 버튼) (0) | 2020.09.12 |
Radio Button (옵션 선택 버튼) (0) | 2020.09.12 |