• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UIInterfaceOrientation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: GetSpineLocation

		public UIPageViewControllerSpineLocation GetSpineLocation (UIPageViewController pageViewController, UIInterfaceOrientation orientation)
		{
			if (orientation == UIInterfaceOrientation.Portrait || UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
				UIViewController currentViewController = pageViewController.ViewControllers [0];
				pageViewController.SetViewControllers (
					new [] { currentViewController },
					UIPageViewControllerNavigationDirection.Forward,
					true, null
				);

				pageViewController.DoubleSided = false;
				return UIPageViewControllerSpineLocation.Min;
			}

			var dataViewController = (DataViewController)pageViewController.ViewControllers [0];
			var indexOfCurrentViewController = modelController.IndexOfViewController (dataViewController);
			UIViewController[] viewControllers = null;

			if (indexOfCurrentViewController == 0 || indexOfCurrentViewController % 2 == 0) {
				UIViewController nextViewController = modelController.GetNextViewController (pageViewController, dataViewController);
				viewControllers = new [] { dataViewController, nextViewController };
			} else {
				UIViewController previousViewController = modelController.GetPreviousViewController (pageViewController, dataViewController);
				viewControllers = new[] { dataViewController, previousViewController };
			}

			pageViewController.SetViewControllers (viewControllers, UIPageViewControllerNavigationDirection.Forward, true, null);
			return UIPageViewControllerSpineLocation.Mid;
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:29,代码来源:RootViewController.cs


示例2: WillAnimateRotation

		/// <summary>
		/// is called when the OS is going to rotate the application. It handles rotating the status bar
		/// if it's present, as well as it's controls like the navigation controller and tab bar, but you 
		/// must handle the rotation of your view and associated subviews. This call is wrapped in an 
		/// animation block in the underlying implementation, so it will automatically animate your control
		/// repositioning.
		/// </summary>
		public override void WillAnimateRotation (UIInterfaceOrientation toInterfaceOrientation, double duration)
		{
			base.WillAnimateRotation (toInterfaceOrientation, duration);
			
			// call our helper method to position the controls
			PositionControls (toInterfaceOrientation);
		}
开发者ID:BoogieMAN2K,项目名称:monotouch-samples,代码行数:14,代码来源:Controller.cs


示例3: ShouldAutorotateToInterfaceOrientation

        public override bool ShouldAutorotateToInterfaceOrientation(UIInterfaceOrientation toInterfaceOrientation)
        {
            var f = this.View.Frame;

            _player.View.Frame = new Rectangle(0,0,(int)f.Height,(int)f.Width);
            return true;
        }
开发者ID:jjabney,项目名称:lucid,代码行数:7,代码来源:VideoViewController.cs


示例4: GetSpineLocation

        public UIPageViewControllerSpineLocation GetSpineLocation(UIPageViewController pageViewController, UIInterfaceOrientation orientation)
        {
            UIViewController currentViewController;
            UIViewController[] viewControllers;

            if (orientation == UIInterfaceOrientation.Portrait || orientation == UIInterfaceOrientation.PortraitUpsideDown || UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
                // In portrait orientation or on iPhone: Set the spine position to "min" and the page view controller's view controllers array to contain just one view controller.
                // Setting the spine position to 'UIPageViewControllerSpineLocation.Mid' in landscape orientation sets the doubleSided property to true, so set it to false here.
                currentViewController = pageViewController.ViewControllers [0];
                viewControllers = new [] { currentViewController };
                pageViewController.SetViewControllers (viewControllers, UIPageViewControllerNavigationDirection.Forward, true, null);

                pageViewController.DoubleSided = false;

                return UIPageViewControllerSpineLocation.Min;
            }

            // In landscape orientation: Set set the spine location to "mid" and the page view controller's view controllers array to contain two view controllers.
            // If the current page is even, set it to contain the current and next view controllers; if it is odd, set the array to contain the previous and current view controllers.
            currentViewController = pageViewController.ViewControllers [0];

            int index = ModelController.IndexOf ((DataViewController)currentViewController);
            if (index == 0 || index % 2 == 0) {
                var nextViewController = ModelController.GetNextViewController (pageViewController, currentViewController);
                viewControllers = new [] { currentViewController, nextViewController };
            } else {
                var previousViewController = ModelController.GetPreviousViewController (pageViewController, currentViewController);
                viewControllers = new [] { previousViewController, currentViewController };
            }

            pageViewController.SetViewControllers (viewControllers, UIPageViewControllerNavigationDirection.Forward, true, null);

            return UIPageViewControllerSpineLocation.Mid;
        }
开发者ID:iOSTestApps,项目名称:BBTestAppXamarin,代码行数:34,代码来源:RootViewController.cs


示例5: DidRotate

 public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)
 {
     base.DidRotate (fromInterfaceOrientation);
     if (aboutScreenView != null) {
         aboutScreenView.Rotate ();
     }
 }
开发者ID:MADMUC,项目名称:TAP5050,代码行数:7,代码来源:AboutScreenController.cs


示例6: DidRotate

		public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)
		{
			if (ViewModel is BaseViewModel)
			{
				((BaseViewModel)ViewModel).WaitForReady(() => InvokeOnMainThread(ViewModelReady));
			}
		}
开发者ID:khellang,项目名称:Solvberget,代码行数:7,代码来源:NamedTableViewController.cs


示例7: DidRotate

        public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)
        {
            base.DidRotate (fromInterfaceOrientation);

            WebView.Frame = new RectangleF (0f * Device.screenWidthP, 0f * Device.screenHeightP, 100f * Device.screenWidthP, 100f * Device.screenHeightP);
            WebView.Reload ();
        }
开发者ID:MADMUC,项目名称:TAP5050,代码行数:7,代码来源:WebViewController.cs


示例8: DidRotate

 public override void DidRotate(UIInterfaceOrientation orientation)
 {
     base.DidRotate(orientation);
     View.SetNeedsDisplay();
     Console.WriteLine("Hypnosis View did rotate - frame" + View.Frame.ToString());
     Console.WriteLine("Hypnosis View did rotate - bounds" + View.Frame.ToString());
 }
开发者ID:yingfangdu,项目名称:BNR,代码行数:7,代码来源:HypnosisViewController.cs


示例9: UpdatePreviewRotation

 public void UpdatePreviewRotation(UIInterfaceOrientation orientation)
 {
     //Re-size camera feed based on orientation
     if (previewLayer == null) return;
     previewLayer.Connection.VideoOrientation = configDicByRotationChanged[orientation];
     previewLayer.Frame = rootView.Bounds;
 }
开发者ID:builttoroam,项目名称:BuildIt,代码行数:7,代码来源:CameraFeedUtility.cs


示例10: ExEnEmTouchScaler

 public ExEnEmTouchScaler(UIInterfaceOrientation orientation, Point renderbufferSize, Point deviceSize)
 {
     this.orientation = orientation;
     this.renderbufferSize = renderbufferSize;
     this.deviceSize = deviceSize;
     Recalculate();
 }
开发者ID:meds,项目名称:ChicksnVixens,代码行数:7,代码来源:ExEnEmTouchScaler.cs


示例11: SizeForItemsInInterfaceOrientation

 public override System.Drawing.SizeF SizeForItemsInInterfaceOrientation(GMGridView.GMGridView gridView, UIInterfaceOrientation orientation)
 {
     SizeF size;
     //Console.WriteLine("SizeForItemsInInterfaceOrientation");
     if (MainViewController.UserInterfaceIdiomIsPhone) {
         if (orientation == UIInterfaceOrientation.LandscapeLeft || orientation == UIInterfaceOrientation.LandscapeRight)
         {
             size = new SizeF(170.0f, 135.0f);
         }
         else
         {
             size = new SizeF(140f, 110f);
         }
     }
     else
     {
         if (orientation == UIInterfaceOrientation.LandscapeLeft || orientation == UIInterfaceOrientation.LandscapeRight)
         {
             size = new SizeF(285.0f, 205.0f);
         }
         else
         {
             size = new SizeF(230.0f, 175.0f);
         }
     }
     Console.WriteLine("Size: {0}; {1}", size.Width, size.Height);
     return size;
 }
开发者ID:aarpy,项目名称:GMGridMono,代码行数:28,代码来源:SlidesGridView.cs


示例12: DidRotate

        public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)
        {
            base.DidRotate(fromInterfaceOrientation);

            UpdateGUI();
            UpdateTableView();
        }
开发者ID:ZuydUniversity,项目名称:ProgramADroid,代码行数:7,代码来源:VCHighScoresMenu.cs


示例13: DidRotate

		public override void DidRotate (UIInterfaceOrientation fromInterfaceOrientation)
		{
			base.DidRotate (fromInterfaceOrientation);

			// update the camera orientation
			stillCamera.OutputImageOrientation = InterfaceOrientation;
		}
开发者ID:cyecp,项目名称:XamarinComponents,代码行数:7,代码来源:MultipleViewController.cs


示例14: DidRotate

 public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)
 {
     base.DidRotate (fromInterfaceOrientation);
     foreach (var x in TableView.VisibleCells) {
         ((ContactListScreenCell)x).Rotate ();
     }
 }
开发者ID:MADMUC,项目名称:TAP5050,代码行数:7,代码来源:ContactListScreenController.cs


示例15: PositionControls

		/// <summary>
		/// A helper method to position the controls appropriately, based on the 
		/// orientation
		/// </summary>
		protected void PositionControls (UIInterfaceOrientation toInterfaceOrientation)
		{
			// depending one what orientation we start in, we want to position our controls
			// appropriately
			switch (toInterfaceOrientation) {
				// if we're switching to landscape
				case UIInterfaceOrientation.LandscapeLeft:
				case UIInterfaceOrientation.LandscapeRight:
					
					// reposition the buttons
					button1.Frame = new System.Drawing.RectangleF (10, 10, 100, 33);
					button2.Frame = new System.Drawing.RectangleF (10, 200, 100, 33);
					
					// reposition the image
					image.Frame = new System.Drawing.RectangleF (240, 25, image.Frame.Width, image.Frame.Height);
					
					break;
				
				// we're switching back to portrait
				case UIInterfaceOrientation.Portrait:
				case UIInterfaceOrientation.PortraitUpsideDown:
					
					// reposition the buttons
					button1.Frame = new System.Drawing.RectangleF (10, 10, 100, 33);
					button2.Frame = new System.Drawing.RectangleF (200, 10, 100, 33);
					
					// reposition the image
					image.Frame = new System.Drawing.RectangleF (20, 150, this.image.Frame.Width, this.image.Frame.Height);
					
					break;
			}
		}
开发者ID:BoogieMAN2K,项目名称:monotouch-samples,代码行数:36,代码来源:Controller.cs


示例16: DidRotate

        public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)
        {
            CheckOrientation ();

            Console.WriteLine("Rotate From {0} to {1} with frame {2}",fromInterfaceOrientation, InterfaceOrientation, this.View.Frame);
            base.DidRotate (fromInterfaceOrientation);
        }
开发者ID:asfungithub,项目名称:sysdrawing-coregraphics,代码行数:7,代码来源:MTUniversalProjectViewController.cs


示例17: DidRotate

        public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)
        {
            base.DidRotate (fromInterfaceOrientation);

            scrollView.Frame = new RectangleF(0,0,baseView.Bounds.Width,baseView.Bounds.Height-36);
            pageControl.Frame = new RectangleF(0,baseView.Bounds.Height-36,baseView.Bounds.Width,36);

            int count = pageControl.Pages;

            RectangleF scrollFrame = scrollView.Frame;
            scrollFrame.Width = scrollFrame.Width * count;
            scrollView.ContentSize = scrollFrame.Size;

            for (int i=0; i<count; i++)
            {
                RectangleF frame = scrollView.Frame;
                PointF location = new PointF();
                location.X = frame.Width * i;

                frame.Location = location;

                scrollView.Subviews[i].Frame = frame;

            }

            float pageOffset = scrollView.Frame.Width*pageControl.CurrentPage;

            PointF p = new PointF(pageOffset, 0);
            scrollView.SetContentOffset(p,true);
        }
开发者ID:SuperYeti,项目名称:MonoTouch-Auto-Rotate-Page-Control-View-Controller,代码行数:30,代码来源:PagingViewController.cs


示例18: ShouldAutorotateToInterfaceOrientation

		public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation)
		{
			if (UserInterfaceIdiomIsPhone)
				return (toInterfaceOrientation != UIInterfaceOrientation.PortraitUpsideDown);

			return true;
		}
开发者ID:sergiimaindev,项目名称:monotouch-samples,代码行数:7,代码来源:MediaCaptureViewController.cs


示例19: ShouldHideViewController

 public override bool ShouldHideViewController(UISplitViewController svc, UIViewController viewController, UIInterfaceOrientation inOrientation)
 {
     //return true; // always hide
     //return true; // never hide
     return inOrientation == UIInterfaceOrientation.Portrait
         || inOrientation == UIInterfaceOrientation.PortraitUpsideDown;
 }
开发者ID:yofanana,项目名称:recipes,代码行数:7,代码来源:SplitViewContoller.cs


示例20: ShouldAutorotateToInterfaceOrientation

		public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation)
		{
			// Return true for supported orientations
			_moviePlayer.View.Frame = this.View.Frame;
			
			return (toInterfaceOrientation != UIInterfaceOrientation.PortraitUpsideDown);
		}
开发者ID:bpug,项目名称:LbkIos,代码行数:7,代码来源:MoviePlayerViewController.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UIKit类代码示例发布时间:2022-05-24
下一篇:
C# UIInput类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap