24.07.17 18:08 작성
·
199
답변 12
0
0
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>
0
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
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
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
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
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
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
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
0
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. 19. 18:59
이메일은 확인이 늦어 질문게시판을 이용해주시면 빠르게 답변드리겠습니다~