コード例 #1
0
ファイル: UIViewExtensions.cs プロジェクト: t9mike/Mitten
        /// <summary>
        /// Anchors the width and height of the view.
        /// </summary>
        /// <param name="view">A view to anchor.</param>
        /// <param name="constant">The width and height.</param>
        /// <returns>The NSLayoutConstraints for the anchor.</returns>
        public static NSLayoutConstraint[] AnchorSize(this UIView view, float constant)
        {
            NSLayoutConstraint[] constraints = new NSLayoutConstraint[2];

            constraints[0] = view.AnchorHeight(constant);
            constraints[1] = view.AnchorWidth(constant);

            return(constraints);
        }