Border Settings
Note:
Currently in the beta phase.
Configure the border style of components.
Import Module
import kit.ArkUI.*
func border(?Length, ?ResourceColor, ?Length, ?BorderStyle)
func border(width!: ?Length, color!: ?ResourceColor, radius!: ?Length,
style!: ?BorderStyle): T
Function: Sets the border style of the component.
Note:
When color and radius are omitted, to ensure that borderColor and borderRadius take effect, they must be specified after border.
System Capability: SystemCapability.ArkUI.ArkUI.Full
Since: 22
Parameters:
| Parameter | Type | Required | Default Value | Description |
|---|---|---|---|---|
| width | ?Length | Yes | - | Named parameter. Border width. Initial value: 0.vp |
| color | ?ResourceColor | Yes | - | Named parameter. Border color. Initial value: Color.Black |
| radius | ?Length | Yes | - | Named parameter. Border radius. Initial value: 0.vp |
| style | ?BorderStyle | Yes | - | Named parameter. Border style. Initial value: BorderStyle.Solid |
Return Value:
| Type | Description |
|---|---|
| T | Returns the component instance itself that calls this interface. |
func borderColor(?ResourceColor)
func borderColor(value: ?ResourceColor): T
Function: Sets the border color of a component.
System Capability: SystemCapability.ArkUI.ArkUI.Full
Since: 22
Parameters:
| Parameter | Type | Required | Default Value | Description |
|---|---|---|---|---|
| value | ?ResourceColor | Yes | - | Border color. Initial value: Color.Black |
Return Value:
| Type | Description |
|---|---|
| T | Returns the component instance itself that calls this interface. |
func borderRadius(?Length)
func borderRadius(value: ?Length): T
Function: Sets the border radius of a component.
System Capability: SystemCapability.ArkUI.ArkUI.Full
Since: 22
Parameters:
| Parameter | Type | Required | Default Value | Description |
|---|---|---|---|---|
| value | ?Length | Yes | - | Border radius. Initial value: 0.0.vp |
Return Value:
| Type | Description |
|---|---|
| T | Returns the component instance itself that calls this interface. |
func borderRadius(?Length, ?Length, ?Length, ?Length)
func borderRadius(topLeft!: ?Length, topRight!: ?Length, bottomLeft!: ?Length,
bottomRight!: ?Length): T
Function: Sets the border radius for each corner of a component.
System Capability: SystemCapability.ArkUI.ArkUI.Full
Since: 22
Parameters:
| Parameter | Type | Required | Default Value | Description |
|---|---|---|---|---|
| topLeft | ?Length | Yes | - | Named parameter. Top-left corner radius. Initial value: 0.vp |
| topRight | ?Length | Yes | - | Named parameter. Top-right corner radius. Initial value: 0.vp |
| bottomLeft | ?Length | Yes | - | Named parameter. Bottom-left corner radius. Initial value: 0.vp |
| bottomRight | ?Length | Yes | - | Named parameter. Bottom-right corner radius. Initial value: 0.vp |
Return Value:
| Type | Description |
|---|---|
| T | Returns the component instance itself that calls this interface. |
func borderStyle(?BorderStyle)
func borderStyle(value: ?BorderStyle): T
Function: Sets the border style of a component.
System Capability: SystemCapability.ArkUI.ArkUI.Full
Since: 22
Parameters:
| Parameter | Type | Required | Default Value | Description |
|---|---|---|---|---|
| value | ?BorderStyle | Yes | - | Border style value. Initial value: BorderStyle.Solid |
Return Value:
| Type | Description |
|---|---|
| T | Returns the component instance itself that calls this interface. |
func borderWidth(?EdgeWidths)
func borderWidth(value: ?EdgeWidths): T
Function: Sets the border width of a component.
System Capability: SystemCapability.ArkUI.ArkUI.Full
Since: 22
Parameters:
| Parameter | Type | Required | Default Value | Description |
|---|---|---|---|---|
| value | ?EdgeWidths | Yes | - | Edge widths. |
Return Value:
| Type | Description |
|---|---|
| T | Returns the component instance itself that calls this interface. |
func borderWidth(?Length)
func borderWidth(value: ?Length): T
Function: Sets the border width of a component.
System Capability: SystemCapability.ArkUI.ArkUI.Full
Since: 22
Parameters:
| Parameter | Type | Required | Default Value | Description |
|---|---|---|---|---|
| value | ?Length | Yes | - | Border width. |
Return Value:
| Type | Description |
|---|---|
| T | Returns the component instance itself that calls this interface. |