当前位置: 首页>>代码示例>>C#>>正文


C# UIEdgeInsets类代码示例

本文整理汇总了C#中UIEdgeInsets的典型用法代码示例。如果您正苦于以下问题:C# UIEdgeInsets类的具体用法?C# UIEdgeInsets怎么用?C# UIEdgeInsets使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UIEdgeInsets类属于命名空间,在下文中一共展示了UIEdgeInsets类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LayoutSubviews

 public override void LayoutSubviews()
 {
     base.LayoutSubviews();
     SeparatorInset = new UIEdgeInsets(0, Bounds.Width, 0, 0);
     TextView.Frame = new RectangleF(0, 0, ContentView.Frame.Width, ContentView.Frame.Height);
     TextView.LayoutIfNeeded();
 }
开发者ID:rcaratchuk,项目名称:MonoTouch.Dialog,代码行数:7,代码来源:MultilinedInputElement.cs

示例2: KeyboardDidShowNotification

        protected virtual void KeyboardDidShowNotification(NSNotification notification)
        {
            UIView activeView = KeyboardGetActiveView();
            if (activeView == null)
                return;

            ((UITextField)activeView).ShowDoneButtonOnKeyboard();

            UIScrollView scrollView = activeView.FindSuperviewOfType(this.View, typeof(UIScrollView)) as UIScrollView;
            if (scrollView == null)
                return;

            RectangleF keyboardBounds = UIKeyboard.BoundsFromNotification(notification);

            UIEdgeInsets contentInsets = new UIEdgeInsets(0.0f, 0.0f, keyboardBounds.Size.Height, 0.0f);
            scrollView.ContentInset = contentInsets;
            scrollView.ScrollIndicatorInsets = contentInsets;

            // If activeField is hidden by keyboard, scroll it so it's visible
            RectangleF viewRectAboveKeyboard = new RectangleF(this.View.Frame.Location, new SizeF(this.View.Frame.Width, this.View.Frame.Size.Height - keyboardBounds.Size.Height));

            RectangleF activeFieldAbsoluteFrame = activeView.Superview.ConvertRectToView(activeView.Frame, this.View);
            // activeFieldAbsoluteFrame is relative to this.View so does not include any scrollView.ContentOffset

            // Check if the activeField will be partially or entirely covered by the keyboard
            if (!viewRectAboveKeyboard.Contains(activeFieldAbsoluteFrame)) {
                // Scroll to the activeField Y position + activeField.Height + current scrollView.ContentOffset.Y - the keyboard Height
                PointF scrollPoint = new PointF(0.0f, activeFieldAbsoluteFrame.Location.Y + activeFieldAbsoluteFrame.Height + scrollView.ContentOffset.Y - viewRectAboveKeyboard.Height);
                scrollView.SetContentOffset(scrollPoint, true);
            }
        }
开发者ID:fdibartolo,项目名称:boletamovil,代码行数:31,代码来源:ScrollableViewController.cs

示例3: UpdateWidth

        public void UpdateWidth(int itemsCount, float width)
        {
            float interval = width / (itemsCount + 1);

            SectionInset = new UIEdgeInsets(0, interval - ITEM_SIZE / 2, 0, 0);
            MinimumLineSpacing = interval - ITEM_SIZE;
        }
开发者ID:TerrorTomec,项目名称:CRM-Mark2,代码行数:7,代码来源:SubMenuFlowLayout.cs

示例4: ImagePanScrollBarView

        public ImagePanScrollBarView(RectangleF frame, UIEdgeInsets edgeInsets)
            : base(frame)
        {
            var scrollbarPath = UIBezierPath.Create ();
            scrollbarPath.MoveTo (new PointF (edgeInsets.Left, Bounds.Height - edgeInsets.Bottom));
            scrollbarPath.AddLineTo (new PointF (Bounds.Width - edgeInsets.Right, Bounds.Height - edgeInsets.Bottom));

            var backgroundLayer = new CAShapeLayer () {
                Path = scrollbarPath.CGPath,
                LineWidth = 1,
                StrokeColor = UIColor.White.ColorWithAlpha (.1f).CGColor,
                FillColor = UIColor.Clear.CGColor
            };

            scrollbarLayer = new CAShapeLayer () {
                Path = scrollbarPath.CGPath,
                LineWidth = 1,
                StrokeColor = UIColor.White.CGColor,
                FillColor = UIColor.Clear.CGColor,
                Actions = new NSDictionary ("strokeStart", NSNull.Null, "strokeEnd", NSNull.Null)
            };

            Layer.AddSublayer (backgroundLayer);
            Layer.AddSublayer (scrollbarLayer);
        }
开发者ID:jmcota,项目名称:PhotoPanner,代码行数:25,代码来源:ImagePan.cs

示例5: LayoutSubviews

        public override void LayoutSubviews()
        {
            base.LayoutSubviews();
            if (ImageView != null)
            {
                var center = ImageView.Center;
                ImageView.Frame = new CGRect(0, 0, ImageSize, ImageSize);
                ImageView.Center = new CGPoint(ImageSize, center.Y);

                if (RoundedImage)
                {
                    ImageView.Layer.MasksToBounds = true;
                    ImageView.Layer.CornerRadius = ImageSize / 2f;
                }
                else
                {
                    ImageView.Layer.MasksToBounds = false;
                    ImageView.Layer.CornerRadius = 0;
                }

                if (TextLabel != null)
                {
                    var frame = TextLabel.Frame;
                    frame.X = ImageSize * 2;
                    frame.Width += (TextLabel.Frame.X - frame.X);
                    TextLabel.Frame = frame;
                }
            }

            SeparatorInset = new UIEdgeInsets(0, TextLabel.Frame.Left, 0, 0);
            SetupNotificationView();
        }
开发者ID:jianwoo,项目名称:CodeHub,代码行数:32,代码来源:MenuTableViewCell.cs

示例6: Draw

        public override void Draw(CGRect rect)
        {
            base.Draw(rect);

            if (BorderWidthAll > 0)
            {
                BorderWidth = new UIEdgeInsets(BorderWidthAll, BorderWidthAll, BorderWidthAll, BorderWidthAll);
            }

            if (BorderColorAll != null)
            {
                BorderColorTop = BorderColorBottom = BorderColorLeft = BorderColorRight = BorderColorAll;
            }

            var xMin = rect.GetMinX();
            var xMax = rect.GetMaxX();

            var yMin = rect.GetMinY();
            var yMax = rect.GetMaxY();

            var fWidth = this.Frame.Size.Width;
            var fHeight = this.Frame.Size.Height;

            var context = UIGraphics.GetCurrentContext();

            if (context != null)
                DrawBorders(context, xMin, xMax, yMin, yMax, fWidth, fHeight);
        }
开发者ID:KiranKumarAlugonda,项目名称:TXTSHD,代码行数:28,代码来源:DrawBorder.cs

示例7: CardLayoutFlow

 public CardLayoutFlow(UIView superView)
 {
     _superView = superView;
     ItemSize = new SizeF(100.0f, 153.0f);
     SectionInset = new UIEdgeInsets(0, 60, 0, 60);
     ScrollDirection = UICollectionViewScrollDirection.Horizontal;
 }
开发者ID:nicwise,项目名称:RotatingCollectionView,代码行数:7,代码来源:CardLayoutFlow.cs

示例8: InsetRect

 // Workaround until this method is available in Xamarin.iOS
 public static CoreGraphics.CGRect InsetRect(CoreGraphics.CGRect rect, UIEdgeInsets insets)
 {
     return new CoreGraphics.CGRect(rect.X + insets.Left,
                            rect.Y + insets.Top,
                            rect.Width - insets.Left - insets.Right,
                            rect.Height - insets.Top - insets.Bottom);
 }
开发者ID:MobileFit,项目名称:CoachV2,代码行数:8,代码来源:PaddingTextField.cs

示例9: LineLayout

		public LineLayout ()
		{
			ItemSize = new CGSize (ITEM_SIZE, ITEM_SIZE);
			ScrollDirection = UICollectionViewScrollDirection.Horizontal;
			SectionInset = new UIEdgeInsets (200, 0.0f, 200, 0.0f);
			MinimumLineSpacing = 50.0f;
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:7,代码来源:LineLayout.cs

示例10: ApplyPadding

partial         void ApplyPadding(System.Windows.Thickness padding)
        {
            var inset = new UIEdgeInsets(padding.TopF(), padding.LeftF(), padding.BottomF(), padding.RightF());
            var tableView = (UITableView)this.NativeUIElement;
            tableView.ContentInset = inset;
            tableView.ScrollIndicatorInsets = inset;
        }
开发者ID:evnik,项目名称:UIFramework,代码行数:7,代码来源:VirtualizingStackPanel.iOS.cs

示例11: AwakeFromNib

        public override void AwakeFromNib()
        {
            base.AwakeFromNib();

              TitleEdgeInsets = new UIEdgeInsets(0, 10, 0, 0);
              SetImage(BACK_IMAGE, UIControlState.Normal);
        }
开发者ID:valryon,项目名称:super-koikoukesse,代码行数:7,代码来源:PXNNavigationBackButton.cs

示例12: ButtonImage

		public static UIImage ButtonImage (UIColor color, float cornerRadius, UIColor shadowColor, UIEdgeInsets shadowInsets)
		{

			UIImage topImage = ImageWithColor (color, cornerRadius);
			UIImage bottomImage = ImageWithColor (shadowColor, cornerRadius);

			float totalHeight = EdgeSizeFromCornerRadius (cornerRadius) + shadowInsets.Top + shadowInsets.Bottom;
			float totalWidth = EdgeSizeFromCornerRadius (cornerRadius) + shadowInsets.Left + shadowInsets.Right;
			float topWidth = EdgeSizeFromCornerRadius (cornerRadius);
			float topHeight = EdgeSizeFromCornerRadius (cornerRadius);
			RectangleF topRect = new RectangleF (shadowInsets.Left, shadowInsets.Top, topWidth, topHeight);
			RectangleF bottomRect = new RectangleF (0, 0, totalWidth, totalHeight);

			UIGraphics.BeginImageContextWithOptions (new SizeF (totalWidth, totalHeight), false, 0.0f);

			if (!RectangleF.Equals (bottomRect, topRect)) {
				bottomImage.Draw (bottomRect);
			}
			topImage.Draw (topRect);

			UIImage buttonImage = UIGraphics.GetImageFromCurrentImageContext ();
			UIGraphics.EndImageContext ();
			UIEdgeInsets resizeableInsets = new UIEdgeInsets (cornerRadius + shadowInsets.Top,
			                                                  cornerRadius + shadowInsets.Left,
			                                                  cornerRadius + shadowInsets.Bottom,
			                                                  cornerRadius + shadowInsets.Right);
			return buttonImage.CreateResizableImage (resizeableInsets);
		}
开发者ID:JackWangCUMT,项目名称:FlatUI.iOS,代码行数:28,代码来源:ImageHelper.cs

示例13: OnKeyboardNotification

 private void OnKeyboardNotification (NSNotification notification)
 {
     var keyboardFrame = UIKeyboard.FrameEndFromNotification (notification);
     var inset = new UIEdgeInsets(0, 0, keyboardFrame.Height, 0);
     TableView.ContentInset = inset;
     TableView.ScrollIndicatorInsets = inset;
 }
开发者ID:xNUTs,项目名称:CodeBucket,代码行数:7,代码来源:TableViewController.cs

示例14: PackageManagerButton

 public PackageManagerButton()
 {
     BackgroundColor = Colors.AppleBlue;
     SetTitleColor(UIColor.White, UIControlState.Normal);
     Layer.CornerRadius = 5;
     HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
     TitleEdgeInsets = new UIEdgeInsets(0, 0, 0, 10);
 }
开发者ID:CartoDB,项目名称:mobile-dotnet-samples,代码行数:8,代码来源:PackageManagerButton.cs

示例15: CustomTableView

		public CustomTableView(RectangleF bounds, UITableViewStyle style) : base(bounds, style)
		{
			ApplyDropShadow();
			
			// Necessary because we are using a transparent navigation bar setting
			// http://stackoverflow.com/questions/2339620/uitableview-add-content-offset-at-top
			ContentInset = new UIEdgeInsets(44, 0, 0, 0);
		}
开发者ID:modulexcite,项目名称:artapp,代码行数:8,代码来源:CustomTableView.cs


注:本文中的UIEdgeInsets类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。