Example #1
0
        private void CommonInit()
        {
            ContentView = ViewFromNib();

            NoDataLabel.Text = Localize.GetText("State.NoDate");

            ContentView.Frame            = Frame;
            ContentView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight & UIViewAutoresizing.FlexibleWidth;
            AutoresizingMask             = UIViewAutoresizing.FlexibleHeight & UIViewAutoresizing.FlexibleWidth;

            AddSubview(ContentView);

            TranslatesAutoresizingMaskIntoConstraints             = false;
            ContentView.TranslatesAutoresizingMaskIntoConstraints = false;

            ContentView.LeadingAnchor.ConstraintEqualTo(LeadingAnchor).Active   = true;
            ContentView.TrailingAnchor.ConstraintEqualTo(TrailingAnchor).Active = true;
            ContentView.BottomAnchor.ConstraintEqualTo(BottomAnchor).Active     = true;
            ContentView.TopAnchor.ConstraintEqualTo(TopAnchor).Active           = true;

            LOTAnimationView lottie = LOTAnimationView.AnimationNamed("no-data");

            lottie.ContentMode = UIViewContentMode.ScaleAspectFit;
            LottieView.Frame   = new CGRect(LottieView.Frame.X, LottieView.Frame.Y, Frame.Width, Frame.Width);
            lottie.Frame       = LottieView.Frame;
            LottieView.AddSubview(lottie);
            lottie.SetFillXContraintTo(LottieView, 16);
            lottie.SetFillYContraintTo(LottieView, 16);
            lottie.SetBottomContraintTo(LottieView, 0, NSLayoutRelation.GreaterThanOrEqual);
            AddConstraint(NSLayoutConstraint.Create(lottie, NSLayoutAttribute.CenterY, NSLayoutRelation.Equal, this, NSLayoutAttribute.CenterY, 1, 0));
            lottie.Play();
        }