<OnClick>
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
जब उपयोगकर्ता किसी व्यू पर टैप करता है, तो इस कार्रवाई के बारे में बताता है. वहाँ हो सकती है
एक के लिए कई <OnClick>
नोड
<Transition>
, जिसमें
हर <OnClick>
एक अलग टारगेट व्यू और
व्यू पर टैप किए जाने पर कार्रवाई करें.
वाक्य-विन्यास
<OnClick
motion:targetId="@id/target_view"
motion:clickAction="action"/>
विशेषताएं
motion:targetId
- व्यू को मॉनिटर किया जा रहा है. जब उपयोगकर्ता इस व्यू पर टैप करता है, तो ट्रांज़िशन
होता है.
motion:ClickAction
- व्यू पर टैप किए जाने पर की जाने वाली कार्रवाई. इन वैल्यू का इस्तेमाल किया जा सकता है:
फ़ॉलो किया जा रहा है:
transitionToStart
- मौजूदा लेआउट से उस लेआउट में ऐनिमेशन जोड़ें जो
<Transition>
एलिमेंट
motion::constraintSetStart
एट्रिब्यूट.
transitionToEnd
- मौजूदा लेआउट से उस लेआउट में ऐनिमेशन जोड़ें जो
<Transition>
एलिमेंट
motion:constraintSetEnd
एट्रिब्यूट.
jumpToStart
- मौजूदा लेआउट से सीधे उस लेआउट पर जाएं जो
<Transition>
एलिमेंट
motion::constraintSetStart
एट्रिब्यूट.
jumpToEnd
- मौजूदा लेआउट से सीधे उस लेआउट पर जाएं जो
<Transition>
एलिमेंट
motion:constraintSetEnd
एट्रिब्यूट.
toggle
- अगर लेआउट शुरुआती स्थिति में है, तो आखिर तक ऐनिमेट करें. या फिर,
ऐनिमेशन को शुरुआत में ही इस्तेमाल करें.
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. 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,["# <OnClick>\n\nSpecifies the action to perform when the user taps on a view. There can be\nmultiple `\u003cOnClick\u003e` nodes for a single\n[`\u003cTransition\u003e`](/training/constraint-layout/motionlayout/ref/transition), with\neach `\u003cOnClick\u003e` specifying a different target view and a different action to\nperform when the view is tapped.\n\nSyntax\n------\n\n```xml\n\u003cOnClick\n motion:targetId=\"@id/target_view\"\n motion:clickAction=\"action\"/\u003e\n```\n\nAttributes\n----------\n\n`motion:targetId`\n: View being monitored. When the user taps this view, the transition\n occurs.\n\n`motion:ClickAction`\n: Action to perform when the view is tapped. Supported values are the\n following:"]]