We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All

MultiWindowEntryInAPP

NOTE

This capability is applicable only when the current device and its screen state support the multitask view. Currently, the following device types support the multitask view:

  • Bi-fold phones in unfolded state

  • Tri-fold phones in Dual screen mode or Triple screen mode (in landscape mode)

  • Tablets in landscape mode

For other device types or states, this component will not respond to any taps on the in-app multi-window icon.

The MultiWindowEntryInAPP component is responsible for implementing the logic for simultaneously running a single app in multiple windows. You can leverage this component to develop this feature for your app based on your service needs.

Device behavior differences: This component is supported only for phones and tablets in specific forms and does not apply for other devices.

Start version: 6.0.0(20)

Modules to Import

PhonePC/2in1TabletTV
NOTE
  • MultiWindowEntryInAPPAttribute is essential for configuring the HdsListItemCard component. In version 6.0.1(21) and earlier, you must manually import MultiWindowEntryInAPPAttribute after importing the MultiWindowEntryInAPP component. Otherwise, a compilation error is reported. However, starting from version 6.0.2(22), the compilation toolchain automatically imports MultiWindowEntryInAPPAttribute when it detects the MultiWindowEntryInAPP component, so manual import is no longer necessary.

  • If you manually import HdsListItemCardAttribute, DevEco Studio shows it as disabled (grayed out). In version 6.0.1(21) and earlier, removing this import causes a compilation error. But from version 6.0.2(22) onward, removing it does not affect the functionality.

Version 6.0.1(21) and earlier:

import { MultiWindowEntryInAPP, MultiWindowEntryInAPPParams, MultiWindowEntryInAPPIconOptions, MultiWindowEntryInAPPSubtitleOptions, MultiWindowEntryInAPPAttribute } from '@kit.UIDesignKit';

Version 6.0.2(22) and later:

import { MultiWindowEntryInAPP, MultiWindowEntryInAPPParams, MultiWindowEntryInAPPIconOptions, MultiWindowEntryInAPPSubtitleOptions } from '@kit.UIDesignKit';

Child Components

PhonePC/2in1TabletTV

None

API

PhonePC/2in1TabletTV

MultiWindowEntryInAPP(params: MultiWindowEntryInAPPParams)

Creates the in-app multi-window component.

System capability: SystemCapability.UIDesign.HDSComponent.Core

Device behavior differences: This API is supported only for phones and tablets in specific forms and does not apply for other devices.

Start version: 6.0.0(20)

Expand
Parameter Type Mandatory Description
params MultiWindowEntryInAPPParams Yes In-app multi-window component parameters.

MultiWindowEntryInAPPParams

PhonePC/2in1TabletTV

Parameters of the MultiWindowEntryInAPP component.

System capability: SystemCapability.UIDesign.HDSComponent.Core

Device behavior differences: This API is supported only for phones and tablets in specific forms and does not apply for other devices.

Start version: 6.0.0(20)

Parameters:

Expand
Name Type Read-Only Optional Description
want Want No No

Parameters for starting multiple windows. The requirements are as follows:

1. The abilityName, moduleName, and bundleName fields are mandatory.

2. App restrictions: All the specified fields (including abilityName, moduleName, and bundleName) must belong to the current app.

3. Cross-app restrictions: The multi-windows function does not support cross-app capabilities.

isShowSubtitle boolean No Yes

Indicates whether to display the component text title.

true: yes

false: no

The default value is false.

multiWindowEntryInAPPStyle MultiWindowEntryInAPPStyle No Yes Component style parameters.

MultiWindowEntryInAPPStyle

PhonePC/2in1TabletTV

Defines the style parameters for the MultiWindowEntryInAPP component.

System capability: SystemCapability.UIDesign.HDSComponent.Core

Device behavior differences: This API is supported only for phones and tablets in specific forms and does not apply for other devices.

Start version: 6.0.0(20)

Parameters:

Expand
Name Type Read-Only Optional Description
iconOptions MultiWindowEntryInAPPIconOptions No Yes Component icon parameters.
subtitleOptions MultiWindowEntryInAPPSubtitleOptions No Yes Component text title parameters.

MultiWindowEntryInAPPIconOptions

PhonePC/2in1TabletTV

Defines the icon parameters for the MultiWindowEntryInAPP component.

System capability: SystemCapability.UIDesign.HDSComponent.Core

Device behavior differences: This API is supported only for phones and tablets in specific forms and does not apply for other devices.

Start version: 6.0.0(20)

Parameters:

Expand
Name Type Read-Only Optional Description
iconColor ResourceColor No Yes

Component icon color.

Default value: $r('sys.color.font_primary')

iconWeight number | FontWeight | string No Yes

Component icon font weight.

The default value is 400.

NOTE:

- For the number type, the value ranges from 100 to 900, at an interval of 100. The default value is 400. A larger value indicates a larger font weight.

- For the string type, only strings that represent a number, for example, 400, and the following enumerated values of FontWeight are supported: Bold, Bolder, Lighter, Regular, and Medium.

iconSize number | string | Resource No Yes

Component icon size.

Default value: 24 x 24 vp

NOTE: Percentages are not supported currently.

backgroundColor ResourceColor No Yes

Background color of the component.

Default value: $r('sys.color.comp_background_tertiary')

MultiWindowEntryInAPPSubtitleOptions

PhonePC/2in1TabletTV

Defines the title text parameter of the MultiWindowEntryInAPP component.

System capability: SystemCapability.UIDesign.HDSComponent.Core

Device behavior differences: This API is supported only for phones and tablets in specific forms and does not apply for other devices.

Start version: 6.0.0(20)

Parameters:

Expand
Name Type Read-Only Optional Description
modifier TextModifier No Yes Component text title modifier.

Attributes

PhonePC/2in1TabletTV

Universal attributes are supported.

NOTE

The width, height, and size attributes do not support percentages currently.

This component does not support the accessibilityDescription and accessibilityText attributes.

Events

PhonePC/2in1TabletTV

Most universal attributes are supported.

NOTE

This component does not support the onClick event. If you want to listen for tap events, use the onTouch event instead.

Example

PhonePC/2in1TabletTV

An app can integrate the in-app multi-window component, allowing users to tap the split-screen button for multiple UIAbility components to be displayed in split-screen mode or enter Multitask view mode.

// Starting from version 6.0.2(22), you do not need to manually import MultiWindowEntryInAPPAttribute. For details, refer to the "Modules to Import" section of the MultiWindowEntryInAPP reference document.
import { MultiWindowEntryInAPP, MultiWindowEntryInAPPAttribute } from '@kit.UIDesignKit';
import { Want } from '@kit.AbilityKit';
import { TextModifier }  from '@kit.ArkUI';

@Entry
@Component
struct MultiWindowEntryInAPPTest {
  @State textModifier: TextModifier = new TextModifier();
  private want: Want = {
    // Replace the values of bundleName, moduleName, and abilityName with those of your app to start the UIAbility in the app.
    bundleName: "com.example.myapplication",
    moduleName: "entry",
    abilityName: "FuncAbility",
  };

  build() {
    Row() {
      MultiWindowEntryInAPP({
        want: this.want, isShowSubtitle: true, multiWindowEntryInAPPStyle: {
          iconOptions: {
            iconSize: 24,
            iconColor: $r('sys.color.font_primary'),
            iconWeight: FontWeight.Normal,
            backgroundColor: $r('sys.color.comp_background_tertiary')
          },
          subtitleOptions: {
            modifier: this.textModifier.fontColor(Color.Black)
          }
        }
      })
        .size({ width: 48, height: 48 })
        .position({ x: 400, y: 30 })
    }
  }
}

Search in References
Enter a keyword.