<KeyAttribute>
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
모션 시퀀스 과정에서 특정 시점의 뷰 속성을 지정합니다. 나
<KeyAttribute>
를 사용하여 뷰의 표준 속성을 설정할 수 있습니다.
뷰의 불투명도 (android:alpha
)가 초기에 0으로 설정되었다고 가정해 보겠습니다.
마지막 <ConstraintSet>
에서 <ConstraintSet>
런을 기록했습니다. 이렇게 하면 기본적으로
뷰가 전체 모션 시퀀스 동안 선형으로 페이드 인됩니다. 뷰를 원하는 경우
80% 동안 보이지 않고 빠르게 페이드인되도록 하려면
motion:framePosition
속성이 80으로 설정된 <KeyAttribute>
노드
0으로 설정된 android:alpha
속성
구문
<KeyAttribute
motion:motionTarget="@id/targetPath"
motion:framePosition="percentage"
[ attribute = value ]
/>
속성
motion:motionTarget
- 속성이 이
<KeyAttribute>
에 의해 제어되는 보기입니다.
motion:framePosition
- 모션 시퀀스에서 뷰가 보유하는 시점을 지정하는 1에서 99 사이의 정수입니다.
이
<KeyAttribute>
에서 지정한 속성입니다. 예를 들어 framePosition
가 25이면 보기의 4분의 1 지점에 지정된 속성이 있다
전달할 수 있습니다.
다음 뷰 속성을 설정할 수 있습니다. 이러한 기능에 대해
속성에 관한 자세한 내용은 View
참조 페이지를 확인하세요.
android:alpha
android:elevation
android:rotation
android:rotationX
android:rotationY
android:scaleX
android:scaleY
android:translationX
android:translationY
android:translationZ
android:visibility
transitionPathRotate
포함된 요소
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[null,null,["최종 업데이트: 2025-07-27(UTC)"],[],[],null,["# <KeyAttribute>\n\nSpecifies view attributes at a specific moment during the motion sequence. You\ncan use `\u003cKeyAttribute\u003e` to set the view's [standard attributes](/reference/android/support/constraint/motion/MotionLayout#standard-attributes).\n\nSuppose a view's opacity (`android:alpha`) is set to 0 in the initial\n`\u003cConstraintSet\u003e` and 1 in the final `\u003cConstraintSet\u003e`. By default, this makes\nthe view linearly fade in for the entire motion sequence. If you want the view\nto remain invisible for 80% of the motion sequence and then fade in quickly, add\na `\u003cKeyAttribute\u003e` node with the `motion:framePosition` attribute set to 80 and\nthe `android:alpha` attribute set to 0.\n\nSyntax\n------\n\n```xml\n\u003cKeyAttribute\n motion:motionTarget=\"@id/targetPath\"\n motion:framePosition=\"percentage\"\n [ attribute = value ]\n/\u003e\n```\n\nAttributes\n----------\n\n`motion:motionTarget`\n: View whose attributes are controlled by this `\u003cKeyAttribute\u003e`.\n\n`motion:framePosition`\n: Integer from 1 to 99 specifying when in the motion sequence the view has the\n attributes specified by this `\u003cKeyAttribute\u003e`. For example, if `framePosition`\n is 25, then the view has the specified attributes one-quarter of the way\n through the motion sequence.\n\nYou can set the following view attributes. For more information about these\nattributes, see the [`View`](/reference/android/view/View) reference page.\n\n- `android:alpha`\n- `android:elevation`\n- `android:rotation`\n- `android:rotationX`\n- `android:rotationY`\n- `android:scaleX`\n- `android:scaleY`\n- `android:translationX`\n- `android:translationY`\n- `android:translationZ`\n- `android:visibility`\n- `transitionPathRotate`\n\nContained in\n------------\n\n- [`\u003cKeyFrameSet\u003e`](/training/constraint-layout/motionlayout/ref/keyframeset)"]]