Windos 10 UWP 设置手机状态栏

来源:互联网 发布:透视衣淘宝 编辑:程序博客网 时间:2024/05/21 17:09


            if (DeviceHelper.IsMobile)
            {
                StatusBar status = StatusBar.GetForCurrentView();
                status.BackgroundColor = Color.FromArgb((byte)0xFF, (byte)0x36, (byte)0xDE, (byte)0xA1);
                status.BackgroundOpacity = 1; // 透明度
                status.ForegroundColor = Colors.Black;
                //status.ProgressIndicator.ShowAsync();
            }
            //设置手机状态栏的颜色
            //StatusBar status = StatusBar.GetForCurrentView();
            //status.BackgroundColor = Color.FromArgb((byte)0xFF, (byte)0x36, (byte)0xDE, (byte)0xA1);
            //status.BackgroundOpacity = 1; // 透明度
            //status.ForegroundColor = Colors.Black;

    public class DeviceHelper
    {
        //判断是否为手机
        public static bool IsMobile => Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons");
    }


1 0
原创粉丝点击