<KeyAttribute>

모션 시퀀스 과정에서 특정 시점의 뷰 속성을 지정합니다. <KeyAttribute>를 사용하여 뷰의 표준 속성을 설정할 수 있습니다.

뷰의 불투명도 (android:alpha)가 초기 <ConstraintSet>에서는 0으로, 최종 <ConstraintSet>에서는 1로 설정되었다고 가정해 보겠습니다. 기본적으로 이렇게 하면 뷰가 전체 모션 시퀀스에서 선형으로 페이드 인됩니다. 뷰가 모션 시퀀스의 80% 동안 보이지 않게 유지된 다음 빠르게 페이드 인되도록 하려면 motion:framePosition 속성이 80으로, android:alpha 속성이 0으로 설정된 <KeyAttribute> 노드를 추가합니다.

문법

<KeyAttribute
  motion:motionTarget="@id/targetPath"
  motion:framePosition="percentage"
  [ attribute = value ]
/>

속성

motion:motionTarget
속성이 이 <KeyAttribute>에 의해 제어되는 뷰입니다.
motion:framePosition
모션 시퀀스에서 뷰가 이 <KeyAttribute>에 의해 지정된 속성을 보유하는 시기를 지정하는 1~99의 정수입니다. 예를 들어 framePosition이 25이면 뷰는 모션 시퀀스의 1/4 지점에 지정된 속성을 갖게 됩니다.

다음 뷰 속성을 설정할 수 있습니다. 이러한 속성에 대한 자세한 내용은 View 참조 페이지를 확인하세요.

  • android:alpha
  • android:elevation
  • android:rotation
  • android:rotationX
  • android:rotationY
  • android:scaleX
  • android:scaleY
  • android:translationX
  • android:translationY
  • android:translationZ
  • android:visibility
  • transitionPathRotate

포함된 요소