<KeyPosition>
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
모션 시퀀스 중에 특정 시점의 뷰 위치를 지정합니다.
이 속성은 모션의 기본 경로를 조정하는 데 사용합니다.
예를 들어 객체가 왼쪽 상단에서 시작하여
기본 모션 시퀀스에 따라 객체를 대각선 아래로 이동
화면 <KeyPosition>
요소를 하나 이상 추가하여
있습니다.
구문
<KeyPosition
motion:motionTarget="@id/targetPath"
motion:framePosition="percentage"
motion:keyPositionType="type"
motion:percentX="xOffset"
motion:percentY="yOffset"
/>
속성
motion:motionTarget
- 모션이 이
<KeyPosition>
에 의해 제어되는 보기
motion:framePosition
- 모션 시퀀스에서 뷰가 도달하는 시점을 지정하는 1~99 사이의 정수입니다.
이
<KeyPosition>
에서 지정한 지점입니다. 예를 들어
framePosition
가 25이면 뷰가 지정된 지점에 도달합니다.
4분의 1 지점에 있을 것입니다.
motion:percentY
motion:percentX
- 뷰가 도달하는 위치를 지정합니다.
keyPositionType
속성은 이러한 값이 해석되는 방식을 지정합니다.
motion:keyPositionType
percentX
및 percentY
값의 방식을 지정합니다.
해석됩니다. 가능한 설정은 다음과 같습니다.
<ph type="x-smartling-placeholder"></ph>
<ph type="x-smartling-placeholder"></ph>
parentRelative
percentX
및 percentY
는
상위 뷰로 이동합니다. X는 왼쪽의 0부터 시작하는 가로축입니다.
1면에서 1로 설정합니다. Y는 세로축이며 0은
1이 맨 아래입니다.
예를 들어 타겟 보기를
percentX
를 1로 설정하고
percentY
를 0.5로 변경합니다.
deltaRelative
percentX
및 percentY
는 다음을 기준으로 지정됩니다.
뷰가 전체 모션 시퀀스에서 이동하는 거리입니다.
X는 가로축, Y는 세로축입니다. 둘 다
0은 해당 축에 있는 뷰의 시작 위치이고 1은 마지막입니다.
있습니다.
타겟 뷰가 100dp 위로, 100dp를 오른쪽으로 이동하지만
보기가 모션의 1/4 동안 40dp 아래로 이동한 다음 호를 뒤로 이동
있습니다. framePosition
를 25로, keyPositionType
를 다음과 같이 설정합니다.
deltaRelative
, percentY
에서 -0.4로 변경합니다.
pathRelative
X축은
0은 시작 위치이고 1은 최종 위치입니다. 이
Y축은 X축과 수직이며
음수 값을 선택할 수도 있습니다 뷰의 초기 위치는
(0,0)
이고 최종 위치는 (1,0)
입니다. 설정
0이 아닌 percentY
를 사용하면 보기가 한 방향으로 호를 만들거나
있습니다.
뷰가 모션 시퀀스의 절반을 차지하여
전체 거리를 넓히고 나머지 90%까지 이동 속도를 높여야 합니다. 설정
framePosition
~50, keyPositionType
~
pathRelative
, percentX
를 0.1로 업데이트합니다.
percentY
는 0으로 유지됩니다.
포함된 요소
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-27(UTC)"],[],[],null,["# <KeyPosition>\n\nSpecifies a view's position at a specific moment during the motion sequence.\nThis attribute is used to adjust the default path of the motion.\n\nFor example, if an object begins at the upper-left corner and ends at the\nlower-right corner, the default motion sequence moves the object diagonally down\nthe screen. By adding one or more `\u003cKeyPosition\u003e` elements, you can deform the\npath.\n\nSyntax\n------\n\n```xml\n\u003cKeyPosition\n motion:motionTarget=\"@id/targetPath\"\n motion:framePosition=\"percentage\"\n motion:keyPositionType=\"type\"\n motion:percentX=\"xOffset\"\n motion:percentY=\"yOffset\"\n/\u003e\n```\n\nAttributes\n----------\n\n`motion:motionTarget`\n: View whose motion is controlled by this `\u003cKeyPosition\u003e`.\n\n`motion:framePosition`\n: Integer from 1 to 99 specifying when in the motion sequence the view reaches\n the point specified by this `\u003cKeyPosition\u003e`. For example, if\n `framePosition` is 25, the view reaches the specified point\n one-quarter of the way through the motion.\n\n`motion:percentX`, `motion:percentY`\n: Specify the position the view reaches. The `keyPositionType`\n attribute specifies how these values are interpreted.\n\n`motion:keyPositionType`\n: Specifies how the `percentX` and `percentY` values are\n interpreted. Possible settings are the following:\n\nContained In\n------------\n\n- [`\u003cKeyFrameSet\u003e`](/training/constraint-layout/motionlayout/ref/keyframeset)"]]