토스트 메시지가 화면 아래가 아닌 위에 뜨도록 바꾸기
trueButton.setOnClickListener { view: View ->
Toast.makeText(this, R.string.correct_toast, Toast.LENGTH_SHORT).run {
this.setGravity(Gravity.TOP, 0, 0)
this.show()
}
}
falseButton.setOnClickListener { view: View ->
Toast.makeText(this, R.string.incorrect_toast, Toast.LENGTH_SHORT).run {
this.setGravity(Gravity.TOP, 0, 0)
this.show()
}
}
'DEVELOPMENT' 카테고리의 다른 글
[실무에 바로 적용하는 안드로이드 프로그래밍] Chapter 3 (0) | 2021.07.17 |
---|---|
[실무에 바로 적용하는 안드로이드 프로그래밍 - Kotlin] Challenge 2: Previous Button & Image Button (0) | 2021.07.16 |
[Android Studio] Chapter 14 연습문제 (0) | 2021.07.09 |
[Android Studio] Chapter 14 직접 풀어보기 (0) | 2021.07.09 |
[Android Studio] Chapter 13 연습문제 (0) | 2021.07.08 |