Windos 10 UWP 設置手機狀態欄



            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");
    }


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章