Пример #1
0
        private PageViewItem CreateItem(float radius, float selectedRadius, UIColor itemColor, bool isSelect = false)
        {
            var item = new PageViewItem(radius, itemColor, selectedRadius, isSelect);
            item.TranslatesAutoresizingMaskIntoConstraints = false;
            item.BackgroundColor = UIColor.Clear;

            this.AddSubview(item);

            return item;
        }
Пример #2
0
        protected void AnimationItem(PageViewItem item, bool selected, double duration, bool fillColor = false)
        {
            var toValue = selected ? selectedItemRadius * 2: itemRadius * 2;
            foreach(var constraint in item.Constraints)
            {
                if (constraint.GetIdentifier() == animationKey)
                    constraint.Constant = toValue;
            }

            UIView.Animate(duration, 0, UIViewAnimationOptions.CurveEaseOut, () =>
            {
                this.LayoutIfNeeded();
            }, () => { });

            item.AnimationSelected(selected, duration, fillColor);
        }