import { window } from ‘@kit.ArkUI’
import { BreakpointConstants } from ‘…/…/common/utils/BreakpointConstants’;
import { getScreenWith } from ‘…/…/common/utils/CmtSystemTool’
import myNavigation from ‘…/…/common/view/navigationBar’;
@Entry
@Component
export struct statel {
@StorageLink(‘currentBreakpoint’) @Watch(‘onBreakpointChange’) currentBreakpoint: string =
BreakpointConstants.BREAKPOINT_SM;
@StorageProp(‘currentOrientation’) @Watch(‘onBreakpointChange’) currentOrientation: window.Orientation = window.Orientation.UNSPECIFIED
onBreakpointChange() {
getScreenWith()//实时获取屏幕尺寸
}
aboutToAppear(): void {
}
aboutToDisappear(): void {
}
onPageHide(): void {
this.commonNavColor()
}
onPageShow(): void {
this.mineNavColor()
}
mineNavColor() {
// 获取当前应用窗口
let windowClass = AppStorage.get<window.Window>(‘windowClass’) as window.Window;
// 将状态栏和导航栏的背景色设置为跟应用窗口相同的颜色
windowClass.setWindowSystemBarProperties({
// 颜色属性为ARGB,将蒙尘设置为0%使其透明
// 导航栏颜色
navigationBarColor: ‘#ffffff’,
// 状态栏颜色
statusBarColor: ‘#41A09A’,
// 状态栏文字颜色
statusBarContentColor: ‘#ffffff’
})
}
commonNavColor() {
// // 获取当前应用窗口
let windowClass = AppStorage.get<window.Window>(‘windowClass’) as window.Window;
// 将状态栏和导航栏的背景色设置为跟应用窗口相同的颜色
windowClass.setWindowSystemBarProperties({
// 颜色属性为ARGB,将蒙尘设置为0%使其透明
// 导航栏颜色
navigationBarColor: ‘#ffffff’,
// 状态栏颜色
statusBarColor: ‘#ffffff’,
// 状态栏文字颜色
statusBarContentColor: ‘#ffffff’
})
}
//首页构建tab
build() {
}
}