c# - 始终在 IOS MVVMCROSS 应用程序中将签名板的方向设置为横向模式

标签 c# ios mvvmcross signaturepad

我已经为我的 iOS 应用程序实现了签名板。 (它不是 native 应用程序。我正在使用 MVVMCROSS 平台进行开发。我希望始终在横向 View 中设置此签名板的方向。我找不到签名板框架的任何参数。

 var signature = new SignaturePadView(View.Frame);
 View.AddSubview(signature);
 signature.Frame = new RectangleF(0, 135, 320, 130);
 //signature.Frame = new RectangleF(0, 135, this.View.Frame.Width, 140);
 signature.BackgroundColor = UIColor.Gray;

我无法确保它始终以横向 View 打开并调整到屏幕宽度。如果有人能提供帮助,我们将很高兴

最佳答案

尝试将以下代码添加到 SignaturePadView 的 ViewController

public override bool ShouldAutorotate()
    {
        return true;
    }

    public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations()
    {
        return UIInterfaceOrientationMask.AllButUpsideDown;
    }

它覆盖方向方法

关于c# - 始终在 IOS MVVMCROSS 应用程序中将签名板的方向设置为横向模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24372402/

相关文章:

c# - Visual Studio 2015 Update 2 让浮点计算更准确?

c# - 该进程无法访问该文件,因为该文件正在被另一个进程使用

c# - 变量如何存储在类中及其执行流程?

iOS:Google+ 按钮在 XIB 文件中不起作用?

ios - 在 Custom Cocoapods 中使用 Storyboards 和 Image assets

mvvm - MvvmCross Core 程序集中的设置?

android - 在 ListView 中绑定(bind) fragment

c# - FindControl GridTemplateColumn 在 radGrid 事件之外

ios - 如何弱链接 iOS 应用程序委托(delegate)方法?

c# - 在 Xamarin.Android 和 MvvmCross 中定义应用程序类的基类