Inheritance: Xamarin.Forms.ScrollView
Beispiel #1
0
        private View CreateSinglePhotoViewer()
        {
            // Create a signle PhotoView
            _photoView = new PhotoView()
            {
                BackgroundColor = Color.Gray
            };

            _photoView.Tap += OnPhotoTab;

            // Add the PhotoView to a layout
            var layout = new RelativeLayout();

            layout.Children.Add(_photoView,
                                xConstraint: Constraint.Constant(0),
                                yConstraint: Constraint.Constant(0),
                                widthConstraint: Constraint.RelativeToParent((parent) =>
            {
                return(parent.Width);
            }),
                                heightConstraint: Constraint.RelativeToParent((parent) =>
            {
                return(parent.Height);
            }));

            return(layout);
        }
        // ------------------------------------------------

        #region Constructors

        public ImageTemplate()
        {
            _photoView = new PhotoView()
            {
                BackgroundColor = Color.Gray
            };
        }
        private View CreateSinglePhotoViewer()
        {
            // Create a signle PhotoView
            _photoView = new PhotoView() { BackgroundColor = Color.Gray };

            _photoView.Tap += OnPhotoTab;

            // Add the PhotoView to a layout
            var layout = new RelativeLayout();

            layout.Children.Add(_photoView, 
                xConstraint: Constraint.Constant(0),
                yConstraint: Constraint.Constant(0),
                widthConstraint: Constraint.RelativeToParent((parent) =>
                    {
                        return parent.Width;
                    }),
                heightConstraint: Constraint.RelativeToParent((parent) =>
                    {
                        return parent.Height;
                    }));

            return layout;
        }
        // ------------------------------------------------

        #region Constructors

        public ImageTemplate()
        {
            _photoView = new PhotoView() { BackgroundColor = Color.Gray };
        }