728x90
반응형
버튼 방식
- 버튼같이 구성 할 수 있는 방식에는
- <Button/>
- <ImageButton/>
- <TextView/>
- 텍스트 뷰에서 자체적으로 클릭할 수 있게도 가능함
TextView 클릭 방식으로 적용 하기
Before
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
After
<TextView
android:id="@+id/helloButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Play"
android:textSize="100dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:id="@+id/helloButton"
android:text="Play"
android:textSize="100dp"
mp3파일 추가
- res 폴더에서 오른쪽 클릭 New -> Android Resource Directory클릭
- value를 raw로 변경
- 그렇게 하고 mp3파일을 생성된 raw넣는다.
- 위와 같은 상태가 되어야함
- 클릭전 상태
- 클릭 후 노래가 재생 되고 글씨가 바뀌는것이 확인 됨
- 물론 이게 완벽한 mp3앱은 아니지만 기본적으로 이렇게 되는것
- 여기서 응용해서 발전하는게 베스트이다.
원본
GitHub: Where the world builds software
GitHub is where over 73 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and feat...
github.com
728x90
반응형
'안드로이드(Android)' 카테고리의 다른 글
2021.10.31_4.6위치기반어플만들기 (0) | 2021.10.31 |
---|---|
2021.10.31_4.5음성인식노트앱만들기 (0) | 2021.10.31 |
2021.10.31_4.3디지털액자완성앱만들기 (0) | 2021.10.31 |
2021.10.31_4.2누구나5분이면따라하는앱만들기 (0) | 2021.10.31 |
2021.10.30_4.1앱개발처음하시는분-간단한앱만들기 (0) | 2021.10.31 |
댓글