gpt4 book ai didi

xamarin.ios - 无法让新的 iOS 7 相机在 UIPopoverController 内缩放

转载 作者:行者123 更新时间:2023-12-02 03:43:32 25 4
gpt4 key购买 nike

我在 UIPopoverController 中显示相机的 iOS 6 代码工作正常,但 iOS 不会缩放相机 View 。请看下面的图片。如有任何建议,我们将不胜感激。

编辑

public class NoRotationUIImagePickerController : UIImagePickerController
{
public override bool ShouldAutorotate ()
{
return false;
}
}

//place imagePicker into a container so that we can control the size of the popover
container = new UIViewController();
container.ContentSizeForViewInPopover = new SizeF(parentViewController.View.Frame.Width, parentViewController.View.Frame.Height);
container.View.AddSubview(_imagePicker.View);

_popOver = new UIPopoverController (container);

//If no camera is available, return false and do nothing.
if (IsCameraHardwareAvailable())
{
_imagePicker.Delegate = new PopUpGalleryPickerDelegate (_popOver, _imageSelected);
_imagePicker.SourceType = UIImagePickerControllerSourceType.Camera;
_imagePicker.AllowsEditing = false;
_imagePicker.MediaTypes = new string[] {"public.image"};

RectangleF popRectangle = new RectangleF (new PointF(parentViewController.View.Frame.Width/2, parentViewController.View.Frame.Height/2), new SizeF (1, 1));

_popOver.PresentFromRect(popRectangle, parentViewController.View, 0, true);
_imagePicker.View.Frame = container.View.Frame; //change to frame must come after popover is presented.
}
else
{
cameraAvailable = false;
}

iOS 6 View iOS 7 View

最佳答案

我最终得到的解决方案是让相机全屏显示,而不是使用弹出 Controller 。

关于xamarin.ios - 无法让新的 iOS 7 相机在 UIPopoverController 内缩放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18748085/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com