본문 바로가기
Android App/App Examples

[App Examples] 앱 배경 화면 이미지 넣는 방법 예제 코드: android:background="@drawable/"

by Henry Cho 2021. 7. 19.
728x90

앱 배경 화면 이미지 넣는 방법 예제 코드: android:background="@drawable/"


<activity_main.xml>

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
    tools:context=".MainActivity"
    android:background="@drawable/applogo"/>

 

<MainActivity.kt>

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Button

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        }
    }

 

<Run>

728x90

댓글