コード例 #1
0
        public override void ViewDidLayoutSubviews()
        {
            base.ViewDidLayoutSubviews();

            var marin = UIScreen.MainScreen.Bounds.Width * 0.056f;

            btnInfo.ContentEdgeInsets = new UIEdgeInsets(marin, marin, marin, marin);

            cnsTableViewHeight.Constant = TableView.ContentSize.Height;

            ScrollView.ContentSize = new CGSize(ScrollView.Frame.Width, TableView.Frame.Y + TableView.ContentSize.Height);

            ScoreView.LayoutSubviews();

            Score.Font = UIFont.FromName("ProximaNova-Bold", SizeConstants.ScreenMultiplier * 24);

            lblScoreGroup.Font = UIFont.FromName("ProximaNova-Bold", SizeConstants.ScreenMultiplier * 14);
            lblScoreGroup.SizeToFit();

            InvokeOnMainThread(() =>
            {
                View.LayoutIfNeeded();
            });

            cnsTableViewHeight.Constant = TableView.ContentSize.Height;
            ScrollView.ContentSize      = new CGSize(ScrollView.Frame.Width, TableView.Frame.Y + TableView.ContentSize.Height);

            var bezierPath = new UIBezierPath();

            bezierPath.MoveTo(new CGPoint(ivTriangle.Layer.Bounds.GetMaxX(), ivTriangle.Layer.Bounds.Y));
            bezierPath.AddLineTo(new CGPoint(ivTriangle.Layer.Bounds.GetMaxX(), ivTriangle.Layer.Bounds.GetMaxY() + 4));
            bezierPath.AddLineTo(new CGPoint(ivTriangle.Layer.Bounds.X, ivTriangle.Layer.Bounds.GetMaxY() + 4));
            bezierPath.AddLineTo(new CGPoint(ivTriangle.Layer.Bounds.X, ivTriangle.Layer.Bounds.GetMaxY()));
            bezierPath.ClosePath();

            ivTriangle.Layer.AddSublayer(new CAShapeLayer
            {
                Frame     = ivTriangle.Bounds,
                Path      = bezierPath.CGPath,
                FillColor = UIColor.White.CGColor
            });
            ivTriangle.Image = null;

            //ScrollToOffset(ScrollView);
        }