Class IconImage
圖示圖片預先定義的圖示、Material Design 圖示,或含有可自訂裁剪樣式的網址圖示。
內容詳盡的說明文件
setAltText(altText)
設定網址的替代文字,用於無障礙功能。
參數
名稱 | 類型 | 說明 |
altText | String | 替代文字。 |
回攻員
IconImage
:這個物件用於鏈結。
setIcon(icon)
如果未設定網址,就會設定預先定義的圖示。預設值為「NONE」。
參數
回攻員
IconImage
:這個物件用於鏈結。
setIconUrl(url)
如果未設定圖示,則會設定圖示的網址。
參數
名稱 | 類型 | 說明 |
url | String | 要用來做為圖示的主機代管圖片網址。 |
回攻員
IconImage
:這個物件用於鏈結。
setImageCropType(imageCropType)
設定圖片的裁剪樣式。您可以為圖示使用 SQUARE
和 CIRCLE
這兩種裁剪類型選項。預設值為 SQUARE
。
參數
回攻員
IconImage
:這個物件用於鏈結。
setMaterialIcon(icon)
設定 Material Design 圖示。
const iconImage = CardService.newIconImage().setMaterialIcon(
CardService.newMaterialIcon().setName('search'),
);
參數
回攻員
IconImage
:這個物件用於鏈結。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-12-04 (世界標準時間)。
[null,null,["上次更新時間:2024-12-04 (世界標準時間)。"],[[["`IconImage` allows you to display a predefined or custom icon using a URL."],["You can customize the icon's appearance with a specific crop style (SQUARE or CIRCLE)."],["Alternative text can be set for accessibility purposes using `setAltText()`."],["The `setIcon()` and `setIconUrl()` methods allow you to specify the icon source, either a predefined icon or a URL."],["All methods return the `IconImage` object, enabling method chaining for streamlined configuration."]]],["The `IconImage` object allows setting an icon using predefined options, a material design icon, or a URL. Key actions include: setting alternative text for accessibility (`setAltText`), choosing a predefined icon (`setIcon`), specifying an icon URL (`setIconUrl`), defining the image crop style (`setImageCropType`), and selecting a material design icon (`setMaterialIcon`). Each method returns the `IconImage` object for chaining additional actions.\n"]]