コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ブロックする >[ブロック] >getIcon
Block.getIcon() メソッド
署名:
getIcon<T extends IIcon>(type: IconType<T> | string): T | undefined;
パラメータ
パラメータ |
型 |
説明 |
type |
IconType<T>|文字列 |
取得するアイコンのタイプ。typescript を使用する際の適切な型チェックのために、IconType を渡すことをおすすめします。 |
戻り値:
火 |未定義
ブロック上に存在すれば、指定されたタイプのアイコン。それ以外の場合は定義されません。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-25 UTC。"],[],["The `Block.getIcon()` method retrieves an icon associated with a block. It accepts a parameter `type`, which specifies the icon type, preferably as an `IconType` for TypeScript type checking, or as a string. The method returns the icon of the specified type if it exists on the block, otherwise, it returns undefined. This allows users to access a specific icon from a Block by providing its corresponding type.\n"],null,[]]