<KeyAttribute>
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
मोशन क्रम के दौरान किसी खास पल पर व्यू एट्रिब्यूट तय करता है. आपने लोगों तक पहुंचाया मुफ़्त में
व्यू के स्टैंडर्ड एट्रिब्यूट को सेट करने के लिए, <KeyAttribute>
का इस्तेमाल किया जा सकता है.
मान लीजिए कि किसी व्यू की ओपैसिटी (android:alpha
), शुरुआत में 0 पर सेट है
फ़ाइनल <ConstraintSet>
में <ConstraintSet>
और 1. डिफ़ॉल्ट रूप से, इससे
पूरे मोशन क्रम में व्यू लीनियर तौर पर फ़ेड इन हो जाता है. अगर आपको यह व्यू
ताकि मोशन क्रम के 80% तक दिखाई न दे और फिर तुरंत फ़ेड इन हो जाए.
motion:framePosition
एट्रिब्यूट वाला <KeyAttribute>
नोड 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 (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,["# <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)"]]