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


C# UIView.Dispose方法代码示例

本文整理汇总了C#中UIView.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# UIView.Dispose方法的具体用法?C# UIView.Dispose怎么用?C# UIView.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UIView的用法示例。


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

示例1: ViewDidLoad

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            View.BackgroundColor = UIColor.White;
            View.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions;

            // Adjust taps/touches required to fit your needs.
            UITapGestureRecognizer tapRecognizer = new UITapGestureRecognizer() {
                NumberOfTapsRequired = 1,
                NumberOfTouchesRequired = 1,
            };
            tapRecognizer.AddTarget((sender) => {
                // The foreach is only necessary if you have more than one touch for your recognizer.
                // For all else just roll with zero, `PointF location = tapRecognizer.LocationOfTouch(0, View);`
                foreach (int locationIndex in Enumerable.Range(0, tapRecognizer.NumberOfTouches)) {
                    PointF location = tapRecognizer.LocationOfTouch(locationIndex, View);
                    UIView newTapView = new UIView(new RectangleF(PointF.Empty, ItemSize)) {
                        BackgroundColor = GetRandomColor(),
                    };
                    newTapView.Center = location;
                    View.Add(newTapView);
                    // Remove the view after it's been around a while.
                    Task.Delay(5000).ContinueWith(_ => InvokeOnMainThread(() => {
                        newTapView.RemoveFromSuperview();
                        newTapView.Dispose();
                    }));
                }
            });
            View.AddGestureRecognizer(tapRecognizer);
        }
开发者ID:patridge,项目名称:UIKitAbuse,代码行数:30,代码来源:PlacingViewsViewController.cs

示例2: Rotate

        UIImage Rotate(UIImage self,float degrees)
        {
            return self;
            // calculate the size of the rotated view's containing box for our drawing space
            UIView rotatedViewBox = new UIView(new System.Drawing.RectangleF(0,0,self.Size.Width * self.CurrentScale,self.Size.Height*self.CurrentScale));
            CGAffineTransform t = CGAffineTransform.MakeRotation(MathHelper.ToRadians(degrees));
            rotatedViewBox.Transform = t;
            var size = rotatedViewBox.Frame.Size;
            Console.WriteLine(size);
            rotatedViewBox.Dispose();
            // Create the bitmap context
            UIGraphics.BeginImageContext(size);
            CGContext bitmap = UIGraphics.GetCurrentContext();

            bitmap.TranslateCTM(size.Width/2,size.Height/2);

            bitmap.RotateCTM(MathHelper.ToRadians(degrees));

               			// Now, draw the rotated/scaled image into the context
            bitmap.ScaleCTM(1,-1);
            bitmap.DrawImage(new System.Drawing.RectangleF(-self.Size.Width*self.CurrentScale /2,-self.Size.Height*self.CurrentScale/2,self.Size.Width*self.CurrentScale,self.Size.Height*self.CurrentScale),self.CGImage);
               			UIImage newImage = UIGraphics.GetImageFromCurrentImageContext();
            UIGraphics.EndImageContext();
               			return newImage;
        }
开发者ID:jbekkedal,项目名称:MonoGame,代码行数:25,代码来源:Game.cs

示例3: NewObjectDispose

 public void NewObjectDispose()
 {
     var obj = new UIView();
     obj.Dispose();
 }
开发者ID:NameNIL,项目名称:iOS4Unity,代码行数:5,代码来源:UIViewTests.cs


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