<KeyAttribute>
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تُستخدَم لتحديد سمات العرض في لحظة معيّنة أثناء تسلسل الحركة. إِنْتَ
يمكنك استخدام <KeyAttribute>
لضبط السمات العادية للملف الشخصي.
لنفترض أنه تم ضبط درجة تعتيم طريقة العرض (android:alpha
) على 0 في القيمة الأولية
<ConstraintSet>
و1 في المباراة النهائية في <ConstraintSet>
. بشكل افتراضي، يجعل هذا
يتلاشى العرض خطيًا لتسلسل الحركة بالكامل. إذا أردت مشاهدة
لتظل غير مرئية لنسبة 80% من تسلسل الحركة ثم تتلاشى بسرعة، تضيف
عقدة <KeyAttribute>
مع ضبط السمة motion:framePosition
على 80
تم تعيين السمة android:alpha
على 0.
بناء الجملة
<KeyAttribute
motion:motionTarget="@id/targetPath"
motion:framePosition="percentage"
[ attribute = value ]
/>
السمات
motion:motionTarget
- الاطّلاع على الأشخاص الذين تتحكّم
<KeyAttribute>
في سماتهم
motion:framePosition
- عدد صحيح من 1 إلى 99 تحدّد فيه متى يكون العرض في تسلسل الحركة
السمات التي تحدّدها السمة
<KeyAttribute>
هذه. على سبيل المثال، إذا كانت framePosition
تساوي 25، فإن طريقة العرض تحتوي على السمات المحددة رُبعًا
من خلال تسلسل الحركة.
يمكنك ضبط سمات الملف الشخصي التالية. لمزيد من المعلومات عن هذه
ذات الصلة، يُرجى الاطّلاع على الصفحة المرجعية View
.
android:alpha
android:elevation
android:rotation
android:rotationX
android:rotationY
android:scaleX
android:scaleY
android:translationX
android:translationY
android:translationZ
android:visibility
transitionPathRotate
موجود في
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],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)"]]