定義一個全局的修改狀態欄的方法,只需要傳入想要修改的色值即可,也可以定義全局的狀態模式,直接調用,根據業務需求自定義。
export const bgcolors:string[]=['#faebd7','#00ffff','#7fffd4','#f5f5dc','#ffe4c4'];
export const textColors:string[]=['#0000ff','#8a2be2','#a52a2a','#008b8b','#6495ed'];
export function changeStatusBarColor(barColor:string,contentColor:string){
window.getLastWindow(getContext(),(_err,win)=>
{
win.setWindowSystemBarProperties({
statusBarColor:barColor, //背景
statusBarContentColor:contentColor, //內容 文字 圖標
});
})
}
statusbar.gif