Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Căn chỉnh
Một enum đại diện cho các kiểu căn chỉnh hình ảnh được hỗ trợ. Bạn có thể truy cập các loại căn chỉnh từ FormApp.Alignment.
Để gọi một enum, bạn gọi lớp mẹ, tên và thuộc tính của enum đó. Ví dụ: FormApp.Alignment.LEFT.
// Open a form by ID and add a new image item with alignmentconstform=FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');constimg=UrlFetchApp.fetch('https://www.google.com/images/srpr/logo4w.png');form.addImageItem().setImage(img).setAlignment(FormApp.Alignment.CENTER);
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eFormApp.Alignment\u003c/code\u003e is an enum used to define the alignment of images within a Google Form.\u003c/p\u003e\n"],["\u003cp\u003eImage alignment options include \u003ccode\u003eLEFT\u003c/code\u003e, \u003ccode\u003eCENTER\u003c/code\u003e, and \u003ccode\u003eRIGHT\u003c/code\u003e, which can be accessed using \u003ccode\u003eFormApp.Alignment.LEFT\u003c/code\u003e, \u003ccode\u003eFormApp.Alignment.CENTER\u003c/code\u003e, and \u003ccode\u003eFormApp.Alignment.RIGHT\u003c/code\u003e respectively.\u003c/p\u003e\n"],["\u003cp\u003eYou can set the alignment of an image item in your form using the \u003ccode\u003esetAlignment()\u003c/code\u003e method and passing in the desired \u003ccode\u003eFormApp.Alignment\u003c/code\u003e property.\u003c/p\u003e\n"]]],[],null,["Alignment\n\nAn enum representing the supported types of image alignment. Alignment types can be accessed from\n[FormApp.Alignment](/apps-script/reference/forms/form-app#Alignment).\n\nTo call an enum, you call its parent class, name, and property. For example, `\nFormApp.Alignment.LEFT`.\n\n```javascript\n// Open a form by ID and add a new image item with alignment\nconst form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');\nconst img = UrlFetchApp.fetch('https://www.google.com/images/srpr/logo4w.png');\nform.addImageItem().setImage(img).setAlignment(FormApp.Alignment.CENTER);\n``` \n\nProperties\n\n| Property | Type | Description |\n|----------|--------|------------------------------------------------|\n| `LEFT` | `Enum` | Align the image to the left side of the form. |\n| `CENTER` | `Enum` | Align the image to the center of the form. |\n| `RIGHT` | `Enum` | Align the image to the right side of the form. |"]]