public Thickness SafeArea()
        {
            UIEdgeInsets sArea = new UIEdgeInsets();

            if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
            {
                sArea = UIApplication.SharedApplication.Delegate.GetWindow().SafeAreaInsets;
                Debug.WriteLine("Safe areas: {0}", sArea.ToString());
            }
            return(new Thickness(sArea.Left, sArea.Top, sArea.Right, sArea.Bottom));
        }
        public bool HasTopNotch()
        {
            if (null == _device)
            {
                _device = new iOSDevice();
            }

            if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
            {
                UIEdgeInsets sArea = UIApplication.SharedApplication.Delegate.GetWindow().SafeAreaInsets;
                Debug.WriteLine("Safe areas: {0}", sArea.ToString());
            }
            return(_device.deviceHasNotch());
        }
        // http://bugzilla.xamarin.com/show_bug.cgi?id=1387
        public void Bug1387_UIEdgeInsets_ToString()
        {
            var insets = new UIEdgeInsets(1, 2, 3, 4);

            Assert.False(insets.ToString().Contains("UIEdgeInsets"));
        }
예제 #4
0
        public bool HasTopNotch()
        {
            if (null == _Device)
            {
                _Device = new iOSDevice();
            }

            if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
            {
                UIEdgeInsets sArea = UIApplication.SharedApplication.Delegate.GetWindow().SafeAreaInsets;
                System.Diagnostics.Debug.WriteLine($"*** {GetType().Name}.{nameof(HasTopNotch)} - Safe area: {sArea.ToString()}");
            }
            return(_Device.deviceHasNotch());
        }
예제 #5
0
        public float[] GetSafeArea()
        {
            UIEdgeInsets sArea = new UIEdgeInsets();

            if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
            {
                sArea = UIApplication.SharedApplication.Delegate.GetWindow().SafeAreaInsets;
                System.Diagnostics.Debug.WriteLine($"*** {GetType().Name}.{nameof(GetSafeArea)} - Safe area:{sArea.ToString()}");
            }
            return(new float[] { (float)sArea.Left, (float)sArea.Top, (float)sArea.Right, (float)sArea.Bottom });
        }