인프런 커뮤니티 질문&답변

tmdrlk365w님의 프로필 이미지

작성한 질문수

[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)

팅김

24.07.17 18:08 작성

·

166

0

선생님 혹시 제가 사진 띄우기하다가 다만들고 6번사진을 누르면 에물레이터가 팅기는 현상이있는데 왜그런지 알수있을까요? 혹시 제 파일을 보실수 있는 방법이있을까요?

답변 12

0

tmdrlk365w님의 프로필 이미지
tmdrlk365w
질문자

2024. 07. 18. 09:13

혹시 이메일 하나만 남겨주실수있을까요?

개복치개발자님의 프로필 이미지
개복치개발자
지식공유자

2024. 07. 19. 18:59

이메일은 확인이 늦어 질문게시판을 이용해주시면 빠르게 답변드리겠습니다~

0

tmdrlk365w님의 프로필 이미지
tmdrlk365w
질문자

2024. 07. 17. 20:48

<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat 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:id="@+id/main"
    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="120dp">

        <ImageView
            android:id="@+id/bo_image_1"
            android:src="@drawable/bo_1"
            android:layout_width="120dp"
            android:layout_height="120dp">
        </ImageView>

        <ImageView
            android:id="@+id/bo_image_2"
            android:src="@drawable/bo_2"
            android:layout_width="120dp"
            android:layout_height="120dp">
        </ImageView>

        <ImageView
            android:id="@+id/bo_image_3"
            android:src="@drawable/bo_3"
            android:layout_width="120dp"
            android:layout_height="120dp">
        </ImageView>

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="120dp">

        <ImageView
            android:id="@+id/bo_image_4"
            android:src="@drawable/bo_4"
            android:layout_width="120dp"
            android:layout_height="120dp">
        </ImageView>

        <ImageView
            android:id="@+id/bo_image_5"
            android:src="@drawable/bo_5"
            android:layout_width="120dp"
            android:layout_height="120dp">
        </ImageView>

        <ImageView
            android:id="@+id/bo_image_6"
            android:src="@drawable/bo_6"
            android:layout_width="120dp"
            android:layout_height="120dp">
        </ImageView>

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="120dp">

        <ImageView
            android:id="@+id/bo_image_7"
            android:src="@drawable/bo_7"
            android:layout_width="120dp"
            android:layout_height="120dp">
        </ImageView>

    </LinearLayout>






</androidx.appcompat.widget.LinearLayoutCompat>
개복치개발자님의 프로필 이미지
개복치개발자
지식공유자

2024. 07. 18. 06:54

문제는 없어 보이는데

제가 한번 실행해보겠습니다.

전체 코드를 압축해서 구글 드라이브에 올려주시거나
깃허브에 올려주시겠어요?

0

tmdrlk365w님의 프로필 이미지
tmdrlk365w
질문자

2024. 07. 17. 20:48

<?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:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".Bts7Activity">

    <ImageView
        android:src="@drawable/bo_7"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    </ImageView>

</androidx.constraintlayout.widget.ConstraintLayout>

0

tmdrlk365w님의 프로필 이미지
tmdrlk365w
질문자

2024. 07. 17. 20:48

<?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:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".Bts6Activity">

    <ImageView
        android:src="@drawable/bo_6"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    </ImageView>

</androidx.constraintlayout.widget.ConstraintLayout>

0

tmdrlk365w님의 프로필 이미지
tmdrlk365w
질문자

2024. 07. 17. 20:47

<?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:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".Bts5Activity">

    <ImageView
        android:src="@drawable/bo_5"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    </ImageView>

</androidx.constraintlayout.widget.ConstraintLayout>

0

tmdrlk365w님의 프로필 이미지
tmdrlk365w
질문자

2024. 07. 17. 20:47

<?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:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".Bts4Activity">

    <ImageView
        android:src="@drawable/bo_4"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    </ImageView>

</androidx.constraintlayout.widget.ConstraintLayout>

0

tmdrlk365w님의 프로필 이미지
tmdrlk365w
질문자

2024. 07. 17. 20:47

<?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:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".Bts3Activity">

    <ImageView
        android:src="@drawable/bo_3"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    </ImageView>

</androidx.constraintlayout.widget.ConstraintLayout>

0

tmdrlk365w님의 프로필 이미지
tmdrlk365w
질문자

2024. 07. 17. 20:47

<?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:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".Bts2Activity">

    <ImageView
        android:src="@drawable/bo_2"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    </ImageView>

</androidx.constraintlayout.widget.ConstraintLayout>

0

tmdrlk365w님의 프로필 이미지
tmdrlk365w
질문자

2024. 07. 17. 20:47

<?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:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".Bts1Activity">

    <ImageView
        android:src="@drawable/bo_1"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

0

tmdrlk365w님의 프로필 이미지
tmdrlk365w
질문자

2024. 07. 17. 20:41

image

0

tmdrlk365w님의 프로필 이미지
tmdrlk365w
질문자

2024. 07. 17. 20:41

package com.minu.bts

import android.content.Intent
import android.os.Bundle
import android.widget.ImageView
import android.widget.Toast
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {

        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        // 1. 화면이 클릭되었다는 것을 알아야 합니다! (프로그램이)
        val image1 = findViewById<ImageView>(R.id.bo_image_1)
        image1.setOnClickListener {

            Toast.makeText(this, "1번 사진 클릭 완료", Toast.LENGTH_LONG).show()

            // 2. 화면이 클릭되면, 다음 화면으로 넘어가서, 사진을 크게 보여줌!

            val intent = Intent(this, Bts1Activity::class.java)
            startActivity(intent)
        }

        //2번째 사진 띄우기
        val image2 = findViewById<ImageView>(R.id.bo_image_2)
        image2.setOnClickListener {

            Toast.makeText(this, "2번 사진 클릭 완료", Toast.LENGTH_LONG).show()

            val intent1 = Intent(this, Bts2Activity::class.java)
            startActivity(intent1)

        }

        //3번째 사진 띄우기
        val image3 = findViewById<ImageView>(R.id.bo_image_3)
        image3.setOnClickListener {

            Toast.makeText(this, "3번 사진 클릭 완료", Toast.LENGTH_LONG).show()

            val intent2 = Intent(this, Bts3Activity::class.java)
            startActivity(intent2)
        }

        //4번째 사진 띄우기
        val image4 = findViewById<ImageView>(R.id.bo_image_4)
        image4.setOnClickListener {

            Toast.makeText(this, "4번 사진 클릭 완료", Toast.LENGTH_LONG).show()

            val intent3 = Intent(this, Bts4Activity::class.java)
            startActivity(intent3)
        }

        //5번 화면 띄우기
        val image5 = findViewById<ImageView>(R.id.bo_image_5)
        image5.setOnClickListener {

            Toast.makeText(this, "5번 사진 클릭 완료", Toast.LENGTH_LONG).show()

            val intent4 = Intent(this, Bts5Activity::class.java)
            startActivity(intent4)
        }

        //6번 화면 띄우기
        val image6 = findViewById<ImageView>(R.id.bo_image_6)
        image6.setOnClickListener {

            Toast.makeText(this, "6번 사진 클릭 완료", Toast.LENGTH_LONG).show()

            val intent5 = Intent(this, Bts6Activity::class.java)
            startActivity(intent5)
        }

        //7번 화면 띄우기
        val image7 = findViewById<ImageView>(R.id.bo_image_7)
        image7.setOnClickListener {

            Toast.makeText(this, "7번 사진 클릭 완료", Toast.LENGTH_LONG).show()

            val intent6 = Intent(this, Bts7Activity::class.java)
            startActivity(intent6)
        }
    }
}

0

개복치개발자님의 프로필 이미지
개복치개발자
지식공유자

2024. 07. 17. 18:12

전체 코드를 복사해서 공유해주시겠어요?

Activity xml 모두 주시면 살펴보겠습니다

스크린샷도 주시면 좋아요!