티스토리 뷰
[Android studio] 버튼 클릭 지점부터 물결 효과 주기 Button ripple 안드로이드 스튜디오
안드로이드 스튜디오 버튼효과 중 누른 지점부터 물결치듯 퍼지는 효과를 포스팅하려 한다.
매우 간단하니 금방 따라올 수 있을 것이다.
Drawable 폴더 아래 xml파일을 생성한다.
내용은 아래 코드를 넣도록 하자
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="#ff0000"> <!-- Ripple Effect 색상 -->
<!-- 배경색 -->
<item android:id="@android:id/background">
<shape android:shape="rectangle">
<solid android:color="#000000"/>
</shape>
</item>
</ripple>
이후 activity_main에서 버튼을 생성하고 backgorund 속성을 지정한다
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hello World!"
android:textColor="#fff"
android:background="@drawable/custum_ripple"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
결과를 확인하고 만족스러운 웃음을 지어주자
'안드로이드 > XML' 카테고리의 다른 글
[Android Studio] 버튼 둥글게 만들기 안드로이드 스튜디오 Button Round (0) | 2020.10.25 |
---|---|
[Android Studio] 버튼 누르는 효과 만들기 클릭 이벤트 효과 Button Press 안드로이드 스튜디오 (0) | 2020.10.24 |
[Android Studio] 간단하게 일정시간 지연시키는 딜레이주기 Delay 안드로이드 스튜디오 (0) | 2020.10.20 |
[Android Studio] 버튼 및 레이아웃 그림자 효과주기 Shadow Effect (0) | 2020.10.19 |
[Android Studio] RecyclerView Divider 구분선, 경계선 넣기 안드로이드 스튜디오 (0) | 2020.10.18 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- amplify build error
- 안드로이드 해시키
- room error
- 안드로이드 스튜디오 해시키
- 깃허브에서 깃랩으로
- next useEffect
- 라이브러리 라이센스
- 깃랩에서 깃허브로
- kotlin
- Android Studio
- rn oss
- rn 오픈소스 라이센스
- next.js ssr deploy
- non-zero exit code detected
- 코틀린
- react native oss
- gitlab mirror
- nextjs ssr deploy
- react.js useEffect
- 안드로이드 스튜디오
- 커밋 이메일 변경
- kakao api notworking
- react native 오픈소스 라이선스
- github mirror
- 깃허브 잔디 옮기기
- next.js useEffect
- Build failed because of webpack errors
- 카카오 해시키
- amplify next.js
- 깃랩 잔디 옮기기
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
글 보관함