import { window } from '@kit.ArkUI';
@Entry
@Component
struct ErrorPage {
aboutToAppear(): void {
window.getLastWindow(this.getUIContext().getHostContext(), (err, windowClass) => {
windowClass.setWindowLayoutFullScreen(false);
windowClass.setWindowSystemBarProperties({
statusBarColor: '#4d000000', // 状态栏颜色
statusBarContentColor: '#000'
});
});
}
build() {
Column()
.width('100%')
.height('100%')
.backgroundColor('#4d000000')
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
}
} import { window } from '@kit.ArkUI';
@Entry
@Component
struct FullScreenTest {
aboutToAppear(): void {
window.getLastWindow(this.getUIContext().getHostContext(), (err, windowClass) => {
windowClass.setWindowLayoutFullScreen(true);
});
}
build() {
Column()
.width('100%')
.height('100%')
.backgroundColor('#f1f3f5')
}
} 效果如下:

@Entry
@Component
struct SafeAreaTest {
build() {
Column()
.height('100%')
.width('100%')
.backgroundColor('#f1f3f5')
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
}
} 效果如下:
