Class BorderStyle
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
边框样式
一个类,表示可应用于 widget 的完整边框样式。
如需调用枚举,您可以调用其父类、名称和属性。例如
CardService.BorderStyle.NO_BORDER
。
详细文档
setCornerRadius(radius)
设置边框的角半径,例如 8。
参数
名称 | 类型 | 说明 |
radius | Integer | 要应用于边框的圆角半径。 |
返回
BorderStyle
- 此对象,用于链式调用。
setStrokeColor(color)
设置边框的颜色。
参数
名称 | 类型 | 说明 |
color | String | 要应用于边框的颜色(采用 #RGB 格式)。 |
返回
BorderStyle
- 此对象,用于链式调用。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003e\u003ccode\u003eBorderStyle\u003c/code\u003e objects define the style of borders applied to widgets, including corner radius, color, and type.\u003c/p\u003e\n"],["\u003cp\u003eYou can customize border styles using methods like \u003ccode\u003esetCornerRadius()\u003c/code\u003e, \u003ccode\u003esetStrokeColor()\u003c/code\u003e, and \u003ccode\u003esetType()\u003c/code\u003e, which allow you to specify the desired attributes.\u003c/p\u003e\n"],["\u003cp\u003eEach customization method returns the \u003ccode\u003eBorderStyle\u003c/code\u003e object, enabling chained method calls for efficient styling.\u003c/p\u003e\n"],["\u003cp\u003eBorder attributes such as corner radius and stroke color are specified using integers and RGB color strings respectively, providing flexibility in design.\u003c/p\u003e\n"],["\u003cp\u003eBorder types are selected from the \u003ccode\u003eBorderType\u003c/code\u003e enum, which offers predefined border styles for easy implementation.\u003c/p\u003e\n"]]],[],null,["# Class BorderStyle\n\nBorderStyle\n\nA class that represents a complete border style that can be applied to widgets.\n\nTo call an enum, you call its parent class, name, and property. For example, `\nCardService.BorderStyle.NO_BORDER`. \n\n### Methods\n\n| Method | Return type | Brief description |\n|------------------------------------------------------|------------------|------------------------------------------------------|\n| [setCornerRadius(radius)](#setCornerRadius(Integer)) | [BorderStyle](#) | Sets the corner radius of the border, for example 8. |\n| [setStrokeColor(color)](#setStrokeColor(String)) | [BorderStyle](#) | Sets the color of the border. |\n| [setType(type)](#setType(BorderType)) | [BorderStyle](#) | Sets the type of the border. |\n\nDetailed documentation\n----------------------\n\n### `set``Corner``Radius(radius)`\n\nSets the corner radius of the border, for example 8.\n\n#### Parameters\n\n| Name | Type | Description |\n|----------|-----------|------------------------------------------------|\n| `radius` | `Integer` | The corner radius to be applied to the border. |\n\n#### Return\n\n\n[BorderStyle](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Stroke``Color(color)`\n\nSets the color of the border.\n\n#### Parameters\n\n| Name | Type | Description |\n|---------|----------|-------------------------------------------------------|\n| `color` | `String` | The color in #RGB format to be applied to the border. |\n\n#### Return\n\n\n[BorderStyle](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Type(type)`\n\nSets the type of the border.\n\n#### Parameters\n\n| Name | Type | Description |\n|--------|---------------------------------------------------------------|------------------|\n| `type` | [BorderType](/apps-script/reference/card-service/border-type) | The border type. |\n\n#### Return\n\n\n[BorderStyle](#) --- This object, for chaining."]]