Get device size [Nut Pie]

Get device size

@ohos.window (window)

Window provides some basic capabilities for managing windows, including the creation and destruction of the current window, setting of various properties, and management and scheduling between windows.

@ohos.display (screen properties)

Screen properties provide some basic capabilities for managing display devices, including obtaining information about the default display device, obtaining information about all display devices, and monitoring the plugging and unplugging behavior of display devices.

Complete source code

import display from '@ohos.display';
import window from '@ohos.window';
import common from '@ohos.app.ability.common';

@Entry
@Component
struct Index 

Guess you like

Origin blog.csdn.net/qq_39132095/article/details/132797071