scaleAnimation

나고수·2022년 5월 2일
0

1일1공부

목록 보기
33/67

//anim 폴더 안에 생성 - scale_animation.xml
<?xml version="1.0" encoding="utf-8"?>
<scale xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="200"
    android:fromXScale="1.0" //시작 x 오프셋 - 1.0은 변경이 없다는 뜻
    android:fromYScale="1.0"
    android:pivotX="50%" // 객체가 확장될 때 고정된 상태로 유지되는 x 좌표. 중앙을 변경 안하고 싶으면 50%으로 두면 되는 듯
    android:pivotY="50%"
    android:toXScale="1.2"//객체가 확장될 때 고정된 상태로 유지되는 x 좌표 
    android:toYScale="1.2" />

그 외 빠르게 시작했다가 느리게 종료하는 등 Interpolator(보간기-두점을 연결하는 방법) 설정가능

val aniBounce = AnimationUtils.loadAnimation(this, R.anim.scale_animation)
binding.textView.startAnimation(aniBounce)
profile
되고싶다

0개의 댓글