コード例 #1
0
        /// Add background which is a big circle
        public static void AddBackground(this MaterialShowcase materialShowcase)
        {
            float radius;
            float targetViewPadding = 7;
            var   center            = materialShowcase.GetOuterCircleCenterPoint(materialShowcase.targetCopyView);

            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad &&
                UIDevice.CurrentDevice.Orientation.IsLandscape())
            {
                radius = (float)materialShowcase.instructionView.Frame.Width - SideMenuWidth;
            }

            else
            {
                radius = materialShowcase.GetOuterCircleRadius(center, materialShowcase.instructionView.Frame, materialShowcase.targetCopyView.Frame);
            }

            materialShowcase.backgroundView = new UIView(new CGRect(0, 0, radius * 2, radius * 2))
            {
                Center = center
            };
            var color = materialShowcase.backgroundPromptColor.ColorWithAlpha(materialShowcase.backgroundPromptColorAlpha);

            materialShowcase.backgroundView.AsCircleWithTransparentCenter(color, (float)(materialShowcase.targetHolderView.Bounds.Width * .5f - targetViewPadding));
            materialShowcase.InsertSubviewBelow(materialShowcase.backgroundView, materialShowcase.instructionView);
        }
コード例 #2
0
        /// Add background which is a big circle
        public static void AddBackground(this MaterialShowcase materialShowcase)
        {
            float radius;
            var   center = materialShowcase.GetOuterCircleCenterPoint(materialShowcase.targetCopyView);

            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
            {
                radius = 300.0f;
            }
            else
            {
                radius = materialShowcase.GetOuterCircleRadius(center, materialShowcase.instructionView.Frame, materialShowcase.targetCopyView.Frame);
            }

            materialShowcase.backgroundView = new UIView(new CGRect(0, 0, radius * 2, radius * 2))
            {
                Center          = center,
                BackgroundColor = materialShowcase.backgroundPromptColor.ColorWithAlpha(materialShowcase.backgroundPromptColorAlpha)
            };
            materialShowcase.backgroundView.AsCircle();
            materialShowcase.InsertSubviewBelow(materialShowcase.backgroundView, materialShowcase.targetRippleView);
        }