本文整理汇总了C#中UIScrollView.SetZoomScale方法的典型用法代码示例。如果您正苦于以下问题:C# UIScrollView.SetZoomScale方法的具体用法?C# UIScrollView.SetZoomScale怎么用?C# UIScrollView.SetZoomScale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIScrollView
的用法示例。
在下文中一共展示了UIScrollView.SetZoomScale方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad ();
gameView = new BoardView();
gameView.Frame = new System.Drawing.RectangleF(0,0,960,640);
scrollView = new UIScrollView();
scrollView.AddSubview(gameView);
scrollView.BackgroundColor = UIColor.DarkGray;
scrollView.MaximumZoomScale = 1f;
scrollView.MinimumZoomScale = .5f;
scrollView.ViewForZoomingInScrollView = delegate{
return gameView;
};
scrollView.ContentSize = gameView.Frame.Size;
scrollView.SetZoomScale(.5f,false);
BoardGame = new Game(gameView);
this.View = scrollView;
gameView.StartGame(new List<Card>{
new Card{Value1 = "1",Value2 = "1"},
new Card{Value1 = "2",Value2 = "2"},
new Card{Value1 = "3",Value2 = "3"},
new Card{Value1 = "4",Value2 = "4"},
new Card{Value1 = "5",Value2 = "5"},
new Card{Value1 = "6",Value2 = "6"},
new Card{Value1 = "7",Value2 = "7"},
new Card{Value1 = "8",Value2 = "8"},
new Card{Value1 = "9",Value2 = "9"},
new Card{Value1 = "10",Value2 = "10"},
new Card{Value1 = "11",Value2 = "11"},
new Card{Value1 = "12",Value2 = "12"},
new Card{Value1 = "13",Value2 = "13"},
new Card{Value1 = "14",Value2 = "14"},
new Card{Value1 = "15",Value2 = "15"},
});
}
示例2: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad ();
RectangleF myBounds = UIScreen.MainScreen.Bounds;
scrollView = new UIScrollView (myBounds);
var documentsDirectory = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
var gallerydirectory = Path.Combine (documentsDirectory, "insurancePhotos");
string imagefilename = photo.ImageFileName;
string path = Path.Combine (gallerydirectory, imagefilename);
UIImage image = UIImage.FromFile (path);
var CanvasSize = image.Size;
//RectangleF Canvas = new RectangleF (new PointF (0, 0), CanvasSize);
// string thumbfilename = AppDelegate.dao.GetThumbfilenameForIndex (index);
// string path = Path.Combine (gallerydirectory, thumbfilename);
// Console.WriteLine ("path:" + path);
// UIImage currentImage = UIImage.FromFile (path);
// SizeF dim = currentImage.Size;
//create new view if none is availble fr recycling
// if (iv == null) {
iv = new UIImageView(new RectangleF(0,0, CanvasSize.Width,CanvasSize.Height)){
ContentMode = UIViewContentMode.ScaleAspectFill
};
// }
iv.Image = image;
scrollView.ContentSize = image.Size;
// blend = new UIView (Canvas);
// blend.Frame = Canvas;
// blend.Opaque = true;
// blend.BackgroundColor = UIColor.Clear;
// blend.AddSubview(iv);
// blend.AddSubview(tgv);
scrollView.AddSubview (iv);
this.View = scrollView;
scrollView.ViewForZoomingInScrollView += (UIScrollView sv) => iv;
scrollView.MaximumZoomScale = 3f;
scrollView.MinimumZoomScale = .3f;
scrollView.SetZoomScale (0.3f, true);
}
示例3: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad ();
if (gvc != null) {
this.ThumbChanged += (object sender, ThumbChangedEventArgs e) => gvc.ChangeThumb ();
}
myBounds = new RectangleF (0, 0, UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height);
scrollView = new UIScrollView (myBounds);
var documentsDirectory = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
var gallerydirectory = Path.Combine (documentsDirectory, "gallery");
string imagefilename = go.imageFileName;
string path = Path.Combine (gallerydirectory, imagefilename);
UIImage image = UIImage.FromFile (path);
var CanvasSize = image.Size;
RectangleF Canvas = new RectangleF (new PointF (0, 0), CanvasSize);
//Canvas = new RectangleF (Canvas.X, Canvas.Y, Canvas.Width, Canvas.Height + myBounds.Y);
// string thumbfilename = AppDelegate.dao.GetThumbfilenameForIndex (index);
// string path = Path.Combine (gallerydirectory, thumbfilename);
// Console.WriteLine ("path:" + path);
// UIImage currentImage = UIImage.FromFile (path);
// SizeF dim = currentImage.Size;
//create new view if none is availble fr recycling
// if (iv == null) {
iv = new UIImageView(Canvas){
ContentMode = UIViewContentMode.ScaleAspectFill
};
// }
iv.Image = image;
tgv = new TagGraphicsView (go, Canvas);
scrollView.ContentSize = Canvas.Size;
scrollView.MaximumZoomScale = 3f;
scrollView.MinimumZoomScale = 0.3f;
blend = new UIView (Canvas);
blend.Frame = Canvas;
blend.Opaque = true;
blend.BackgroundColor = UIColor.Clear;
blend.AddSubview(iv);
blend.AddSubview(tgv);
scrollView.AddSubview (blend);
scrollView.ViewForZoomingInScrollView += (UIScrollView sv) => blend;
scrollView.SetZoomScale (0.3f, true);
scrollView.UserInteractionEnabled = true;
scrollView.AlwaysBounceHorizontal = true;
scrollView.AlwaysBounceVertical = true;
Add(scrollView);
doubletap = new UITapGestureRecognizer (AddTag);
doubletap.NumberOfTapsRequired = 2;
scrollView.AddGestureRecognizer (doubletap);
AddLongPress ();
CreateEditBarButton ();
ExtractNewThumbnail();
// CreateSlideDownMenu ();
// UIButton backbutton = new UIButton(new RectangleF(10,25,48,32));
// backbutton.SetImage (backarrow.MakeBackArrow(), UIControlState.Normal);
// backbutton.TouchUpInside += (object sender, EventArgs e) => DismissViewControllerAsync (true);
// Add (backbutton);
CreateMenuOptions ();
}