반응형
res->drawable 폴더에 이미지 넣기
이미지 넣었으면 하단과 같이 android:background="@drawable/(넣은 이미지이름)"
넣어주면 이미지가 앱 전체에 배경화면으로 사용된다.
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/love"
tools:context=".MainActivity">
<Button
android:id="@+id/showAllSentenceBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="전체말씀보기"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/good"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="명언이 들어갈 위치입니다"
android:fontFamily="@font/bmjua_ttf"
android:layout_margin="20dp"
android:gravity="center"
android:textColor="@color/white"
android:textSize="30sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
반응형
'kotlin↗ > 안드로이드 스튜디오 메이킹' 카테고리의 다른 글
KOTLIN]해당 이미지(버튼)을 누르면 원하는 화면으로 넘어가기 (0) | 2024.02.01 |
---|---|
KOTLIN]이미지 일정하게 간격 두면서 테두리 둥글게 만들기 (0) | 2024.02.01 |
KOTLIN]어플 키면 처음에 등장하는 Splash 화면 만들기 (0) | 2024.02.01 |
KOTLIN]ListView A,B,C 누르는 기본적인 항목 만들기 (1) | 2024.02.01 |
KOTLIN] ListView 작성하기 (0) | 2024.02.01 |