コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
モーション シーケンスの特定の時点におけるビューの位置を指定します。
この属性は、デフォルトのモーションパスを調整するために使用されます。
たとえば、オブジェクトが左上隅から始まり、
デフォルトのモーション シーケンスにより、オブジェクトが斜め下に移動します。
画面に表示されます。1 つ以上の <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:percentX
、motion:percentY
- ビューが到達する位置を指定します。
keyPositionType
属性は、これらの値の解釈方法を指定します。
motion:keyPositionType
percentX
値と percentY
値の動作を指定します
解釈されます。可能な設定は次のとおりです。
<ph type="x-smartling-placeholder"></ph>
<ph type="x-smartling-placeholder"></ph>
parentRelative
percentX
と percentY
は、
親ビューで表示されます。X は横軸で、左辺は 0 です。
右辺を 1 にしますY は縦軸で、0 は
1 が一番下です。
たとえば、ターゲット ビューが
親ビューの右側で、percentX
を 1 に設定し、
percentY
を 0.5 にします。
deltaRelative
percentX
と percentY
は、
モーション シーケンス全体でビューが移動する距離。
X は横軸、Y は縦軸です。両方
0 はその軸におけるビューの開始位置、1 は最後のビューです。
なります。
ターゲット ビューが上に 100 dp、右に 100 dp 移動するが、
動きの 4 分の 1 の間、ビューが 40 dp 下がった後、後ろに円弧になっている
選択します。framePosition
を 25 に、keyPositionType
を以下に設定します。
deltaRelative
、percentY
を -0.4 に設定しました。
pathRelative
X 軸は、ターゲット ビューの
0 が開始位置、1 が最終位置です。「
Y 軸は X 軸と垂直で、Y 軸は Y 軸の左側に正の値になります。
負の値は右側に示されますビューの初期位置は、
(0,0)
、最終位置は (1,0)
です。設定では、
ゼロ以外の percentY
の場合、ビューは一方向に円弧、または
あります。
モーション シーケンスの半分で、ビュー全体の 10% をカバーするとします。
残りの 90%は走行速度を上げますセット
framePosition
~ 50、keyPositionType
~
pathRelative
、percentX
を 0.1 に設定します。
percentY
は 0 のままです。
親要素
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は 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)"]]