本文整理汇总了C#中UIInterfaceOrientation类的典型用法代码示例。如果您正苦于以下问题:C# UIInterfaceOrientation类的具体用法?C# UIInterfaceOrientation怎么用?C# UIInterfaceOrientation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UIInterfaceOrientation类属于命名空间,在下文中一共展示了UIInterfaceOrientation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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);
}
示例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;
}
示例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;
}
示例5: DidRotate
public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)
{
base.DidRotate (fromInterfaceOrientation);
if (aboutScreenView != null) {
aboutScreenView.Rotate ();
}
}
示例6: DidRotate
public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)
{
if (ViewModel is BaseViewModel)
{
((BaseViewModel)ViewModel).WaitForReady(() => InvokeOnMainThread(ViewModelReady));
}
}
示例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 ();
}
示例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());
}
示例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;
}
示例10: ExEnEmTouchScaler
public ExEnEmTouchScaler(UIInterfaceOrientation orientation, Point renderbufferSize, Point deviceSize)
{
this.orientation = orientation;
this.renderbufferSize = renderbufferSize;
this.deviceSize = deviceSize;
Recalculate();
}
示例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;
}
示例12: DidRotate
public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)
{
base.DidRotate(fromInterfaceOrientation);
UpdateGUI();
UpdateTableView();
}
示例13: DidRotate
public override void DidRotate (UIInterfaceOrientation fromInterfaceOrientation)
{
base.DidRotate (fromInterfaceOrientation);
// update the camera orientation
stillCamera.OutputImageOrientation = InterfaceOrientation;
}
示例14: DidRotate
public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)
{
base.DidRotate (fromInterfaceOrientation);
foreach (var x in TableView.VisibleCells) {
((ContactListScreenCell)x).Rotate ();
}
}
示例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;
}
}