<クリック時>
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ユーザーがビューをタップしたときに実行するアクションを指定します。一部の商品については、
単一のシステムに対して複数の <OnClick>
ノードを
<Transition>
、
各 <OnClick>
で、異なるターゲット ビューと、それに対する異なるアクションを指定
ビューがタップされたときに実行するアクションを指定します。
構文
<OnClick
motion:targetId="@id/target_view"
motion:clickAction="action"/>
属性
motion:targetId
- 監視中のビュー。ユーザーがこのビューをタップすると、画面遷移が
発生します。
motion:ClickAction
- ビューがタップされたときに実行するアクション。サポートされる値は、
次のとおりです。
<ph type="x-smartling-placeholder">
</ph>
<ph type="x-smartling-placeholder"></ph>
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:"]]