上海建设工程招投标网站,icp备案和icp许可证区别,多说插件 wordpress,wordpress设为中文本节主要讲述在苹果环境中使用monodevelop开发ipad的一个实例#xff0c;具体操作如下 1、新建项目 选择monotouch--ipad--Empty project 命名为iPad01 2、添加新文件#xff0c;选择monotouch--ipad view#xff0c;命名为showView#xff0c;这样会在项目中多出来三个文件…     本节主要讲述在苹果环境中使用monodevelop开发ipad的一个实例具体操作如下     1、新建项目 选择monotouch--ipad--Empty project 命名为iPad01     2、添加新文件选择monotouch--ipad view命名为showView这样会在项目中多出来三个文件。     3、在AppDelegate.cs中添加如下代码以在运行后初始化运行界面为ShowView        1      UIWindow window;2      showViews shows;3 4      public override bool FinishedLaunching(UIApplication app, NSDictionary options) {5                 // create a new window instance based on the screen size6                 window  new UIWindow(UIScreen.MainScreen.Bounds);7                 shows  new showViews();8                 window.RootViewController  shows;9                 // If you have defined a view, add it here:
10                 // window.AddSubview (navigationController.View);
11 
12                 // make the window visible
13                 window.MakeKeyAndVisible();
14 
15                 return true;
16      }         4、添加新类MyViewController.cs此类继承UIViewController重写ipad的自动旋转行为代码如下         using MonoTouch.UIKit;namespace ipad01 {public class MyViewController:UIViewController {public MyViewController() {}public override bool ShouldAutorotateToInterfaceOrientation(UIInterfaceOrientation toInterfaceOrientation) {return true;}}
}           5、在showViews.cs中添加如下代码   1      public override void ViewDidLoad() {2     base.ViewDidLoad();3 4     var text  new UITextView();5     text.Text  gwtGolden Gate Bridge,\nSan Francisco;6     text.Font  UIFont.FromName(Helvetica, 36f);7     text.Frame  new System.Drawing.RectangleF(200, 40, 400, 100);8     text.AutoresizingMask  UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleTopMargin |9               UIViewAutoresizing.FlexibleRightMargin | UIViewAutoresizing.FlexibleBottomMargin;
10     text.ScrollEnabled  false;
11     text.Editable  false;
12     UIImage image  UIImage.FromFile(GoldenGate.jpg);
13     UIImageView imageView  new UIImageView(image);
14     var customScrollView  new UIScrollView(this.View.Bounds);
15     customScrollView.AutoresizingMask  UIViewAutoresizing.FlexibleHeight
16               | UIViewAutoresizing.FlexibleWidth;
17     customScrollView.AddSubview(imageView);
18 
19 
20     customScrollView.PagingEnabled  false; // freeform scrolling
21     customScrollView.ContentSize  imageView.Frame.Size; 
22     customScrollView.MaximumZoomScale  4f;
23     customScrollView.MinimumZoomScale  0.25f;
24     customScrollView.Bounces  false;
25     customScrollView.BouncesZoom  false;
26     customScrollView.IndicatorStyle  UIScrollViewIndicatorStyle.White;
27     customScrollView.ViewForZoomingInScrollView  delegate (UIScrollView sender) {
28               return imageView;
29     };
30     customScrollView.ContentOffset  new System.Drawing.PointF(250, 20);
31     customScrollView.ZoomScale  1.3f; //
32     var customViewController  new MyViewController();
33     customViewController.Add(customScrollView);
34     customViewController.Add(text);
35     this.View.Add(customViewController.View);}          7ok将要使用的图像文件添入到项目并保证其右键Build Action属性为Content。程序运行效果图如下  转载于:https://www.cnblogs.com/flowwind/archive/2012/10/19/2731327.html