<Übergang>
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Gibt den Anfangs- und Endzustand einer Bewegungsabfolge an, also das Ziel
Zwischenzuständen und den Nutzerinteraktionen, die die Bewegung auslösen.
Syntax
<Transition
motion:constraintSetStart="start"
motion:constraintSetEnd="end"
[ motion:duration="integer" ] >
...
</Transition>
Attribute
motion:constraintSetStart
- Anfänglicher Zustand der Bewegungsabfolge. Dies kann entweder die ID eines
<ConstraintSet>
oder ein Layout. Wenn Sie eine <ConstraintSet>
angeben möchten, legen Sie Folgendes fest:
Attribut für
"@+id/constraintSetId"
. Um ein Layout anzugeben, legen Sie
es an "@layout/layoutState"
.
motion:constraintSetEnd
- Endgültiger Status der Bewegungsabfolge. Dies kann entweder die ID eines
<ConstraintSet>
oder ein Layout. Wenn Sie eine <ConstraintSet>
angeben möchten, legen Sie Folgendes fest:
auf "@+id/constraintSetId"
setzen. Um eine
auf "@layout/layoutState"
.
motion:duration
- Dauer der Bewegungsabfolge in Millisekunden. Wenn keine Angabe erfolgt, wird der
<MotionScene>
defaultDuration
des Elements verwendet wird.
Kann enthalten
<onClick>
- Gibt an, dass die Bewegungsabfolge durch eine Berührung des Nutzers ausgelöst wird.
<onSwipe>
- Gibt an, dass die Bewegungsabfolge durch das Wischen des Nutzers ausgelöst wird.
<KeyFrameSet>
- Gibt eine oder mehrere Zwischenpositionen oder Attributeinstellungen für
Elemente in der Bewegungsabfolge.
Enthalten in
Alle Inhalte und Codebeispiele auf dieser Seite unterliegen den Lizenzen wie im Abschnitt Inhaltslizenz beschrieben. Java und OpenJDK sind Marken oder eingetragene Marken von Oracle und/oder seinen Tochtergesellschaften.
Zuletzt aktualisiert: 2025-07-27 (UTC).
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-07-27 (UTC)."],[],[],null,["# <Transition>\n\nSpecifies the beginning and end state of a motion sequence, the target\nintermediate states, and the user interactions that trigger the motion.\n\nSyntax\n------\n\n```xml\n\u003cTransition\n motion:constraintSetStart=\"start\"\n motion:constraintSetEnd=\"end\"\n [ motion:duration=\"integer\" ] \u003e\n ...\n\u003c/Transition\u003e\n```\n\nAttributes\n----------\n\n`motion:constraintSetStart`\n: Initial state of the motion sequence. This can either be the ID of a\n [`\u003cConstraintSet\u003e`](/training/constraint-layout/motionlayout/ref/constraintset)\n or a layout. To specify a `\u003cConstraintSet\u003e`, set this\n attribute to\n `\"@+id/`\u003cvar translate=\"no\"\u003econstraintSetId\u003c/var\u003e`\"`. To specify a layout, set\n it to `\"@layout/`\u003cvar translate=\"no\"\u003elayoutState\u003c/var\u003e`\"`.\n\n`motion:constraintSetEnd`\n: Final state of the motion sequence. This can either be the ID of a\n `\u003cConstraintSet\u003e`, or a layout. To specify a `\u003cConstraintSet\u003e`, set this\n attribute to `\"@+id/`\u003cvar translate=\"no\"\u003econstraintSetId\u003c/var\u003e`\"`. To specify a\n layout, set it to `\"@layout/`\u003cvar translate=\"no\"\u003elayoutState\u003c/var\u003e`\"`.\n\n`motion:duration`\n: Duration of the motion sequence in milliseconds. If not specified, the\n [`\u003cMotionScene\u003e`](/training/constraint-layout/motionlayout/ref/motionscene)\n element's `defaultDuration` is used.\n\nCan contain\n-----------\n\n[`\u003conClick\u003e`](/training/constraint-layout/motionlayout/ref/onclick)\n: Indicates that the motion sequence is triggered by a user touch.\n\n[`\u003conSwipe\u003e`](/training/constraint-layout/motionlayout/ref/onswipe)\n: Indicates that the motion sequence is triggered by a user swipe.\n\n[`\u003cKeyFrameSet\u003e`](/training/constraint-layout/motionlayout/ref/keyframeset)\n: Specifies one or more intermediate positions or attribute settings for\n elements in the motion sequence.\n\nContained in\n------------\n\n- [`\u003cMotionScene\u003e`](/training/constraint-layout/motionlayout/ref/motionscene)"]]