Example #1
0
 private void FullInit(object o = null, NSNotificationEventArgs args = null)
 {
     SetupCamera(true);
     StartPreview();
     NativeView.Add(_liveCameraStream);
     NativeView.ClipsToBounds = true;
 }
Example #2
0
        public override void SetVirtualView(IView view)
        {
            base.SetVirtualView(view);

            var oldContent = _content;

            _content = VirtualView?.Content?.ToNative(MauiContext);
            if (oldContent != _content)
            {
                oldContent.RemoveFromSuperview();
            }
            if (_content != null)
            {
                //_content.SizeToFit();
                NativeView.Add(_content);
            }

            if (VirtualView.Orientation == Orientation.Horizontal)
            {
                NativeView.ShowsVerticalScrollIndicator   = false;
                NativeView.ShowsHorizontalScrollIndicator = true;
            }
            else
            {
                NativeView.ShowsVerticalScrollIndicator   = true;
                NativeView.ShowsHorizontalScrollIndicator = false;
            }
        }
Example #3
0
        private void SetupUserInterface()
        {
            liveCameraStream = new UIView()
            {
                Frame = new CGRect(0f, 0f, NativeView.Bounds.Width, NativeView.Bounds.Height)
            };

            NativeView.Add(liveCameraStream);
        }
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);

            xamarinView                 = e.NewElement as PickerColorSelectorView;
            picker                      = InfColorPickerController.ColorPickerViewController;
            picker.View.Frame           = new CGRect(0, 50, View.Frame.Width, NativeView.Frame.Height - 50);
            xamarinView.BackgroundColor = picker.View.BackgroundColor.ToColor();
            NativeView.Add(picker.View);
        }
Example #5
0
        protected override void OnElementChanged(ElementChangedEventArgs <View> e)
        {
            base.OnElementChanged(e);

            var view = e.NewElement;

            var circleView = new CircleView(view.WidthRequest / 2)
            {
                Frame = new CGRect(0, 0, (nfloat)view.WidthRequest, (nfloat)view.HeightRequest)
            };

            NativeView.Add(circleView);
        }
        protected override void OnElementChanged(ElementChangedEventArgs <View> e)
        {
            base.OnElementChanged(e);

            //Create UITableViewController
            table = new UITableViewController_IBUCalcTableView();
            //Create blank UIView
            view = new UIView();
            //Add the UITableViewController to the UIView
            view.Add(table.View);
            //Add the UIView to the NativeView
            NativeView.Add(view);
        }
Example #7
0
        public override void LayoutSubviews()
        {
            base.LayoutSubviews();

            //layout the elements depending on what screen orientation we are.
            if (DeviceHelper.iOSDevice.Orientation == UIDeviceOrientation.Portrait)
            {
                playButton.Frame   = new CGRect(0, NativeView.Frame.Bottom - 50, NativeView.Frame.Width, 50);
                _playerLayer.Frame = NativeView.Frame;
                NativeView.Layer.AddSublayer(_playerLayer);
                NativeView.Add(playButton);
            }
            else if (DeviceHelper.iOSDevice.Orientation == UIDeviceOrientation.LandscapeLeft || DeviceHelper.iOSDevice.Orientation == UIDeviceOrientation.LandscapeRight)
            {
                _playerLayer.Frame = NativeView.Frame;
                NativeView.Layer.AddSublayer(_playerLayer);
                playButton.Frame = new CGRect(0, 0, 0, 0);
            }
        }
Example #8
0
 private void SetupUserInterface()
 {
     SetupCamera();
     NativeView.Add(_liveCameraStream);
     NativeView.ClipsToBounds = true;
 }