عنصر تحكّم قابل للتخصيص لتصغير المحتوى وتوسيعه
متاحة لتطبيقات Google Chat. في الإصدار التجريبي من إضافات Google Workspace
const collapseButton = CardService.newTextButton() .setTextButtonStyle(CardService.TextButtonStyle.BORDERLESS) .setText('Collapse'); const expandButton = CardService.newImageButton() .setImageButtonStyle(CardService.ImageButtonStyle.FILLED); const collapseControl = CardService.newCollapseControl() .setHorizontalAlign(CardService.HorizontalAlignment.END) .setExpandButton(expandButton) .setCollapseButton(collapseButton);
الطُرق
| الطريقة | نوع القيمة التي تم إرجاعها | وصف قصير |
|---|---|---|
set | Collapse | تضبط هذه السمة Button التي يتم عرضها لزر "إظهار محتوى أقل". |
set | Collapse | تضبط هذه السمة Button الذي يتم عرضه لزر "عرض المزيد". |
set | Collapse | تضبط هذه السمة Horizontal الخاصة بـ Collapse. |
مستندات تفصيلية
setCollapseButton(button)
تضبط هذه السمة Button التي يتم عرضها لزر "إظهار محتوى أقل". اختياريّ.
يجب ضبط هذا الخيار مع زر التصغير.
const collapseButton = CardService.newTextButton().setText('Collapse'); const collapseControl = CardService.newCollapseControl() .setCollapseButton(collapseButton);
المعلمات
| الاسم | النوع | الوصف |
|---|---|---|
button | Button | زر التصغير الذي سيتم ضبطه |
الإرجاع
CollapseControl: هذا العنصر، للتسلسل
setExpandButton(button)
تضبط هذه السمة Button الذي يتم عرضه لزر "عرض المزيد". اختياريّ.
يجب ضبط هذا الخيار مع زر التصغير.
const expandButton = CardService.newTextButton().setText('Expand'); const collapseControl = CardService.newCollapseControl() .setExpandButton(expandButton);
المعلمات
| الاسم | النوع | الوصف |
|---|---|---|
button | Button | زر التوسيع المطلوب ضبطه |
الإرجاع
CollapseControl: هذا العنصر، للتسلسل
setHorizontalAlign(horizontalAlignment)
تضبط هذه السمة HorizontalAlignment الخاصة بـ CollapseControl. اختياريّ. *
const collapseControl = CardService.newCollapseControl().setHorizontalAlign( CardService.HorizontalAlignment.START, );
المعلمات
| الاسم | النوع | الوصف |
|---|---|---|
horizontal | Horizontal | المحاذاة الأفقية للأداة CollapseControl |
الإرجاع
CollapseControl: هذا العنصر، للتسلسل