[英]Xamarin forms Stop screen shot and record in ios
I have xamarin forms app and need to prevent user from take screen shot or record screen these implemented for android using these: Window.SetFlags(WindowManagerFlags.Secure, WindowManagerFlags.Secure); 我们有没有为 ios 做这些
谢谢
正如 Jason 所说,您可以在 Google 中找到更多信息。 您可以尝试使用 ios 下面的代码来模糊或隐藏截取的屏幕截图,以隐藏敏感信息。 我希望这对你有帮助。
一种简单的方法是在 AppDelegate 调用 OnResignActivation 时设置模糊。
UIVisualEffectView _blurWindow = null;
public override void OnActivated(UIApplication application)
{
base.OnActivated(application);
_blurWindow?.RemoveFromSuperview();
_blurWindow?.Dispose();
_blurWindow = null;
}
public override void OnResignActivation(UIApplication application)
{
base.OnResignActivation(application);
using (var blurEffect = UIBlurEffect.FromStyle(UIBlurEffectStyle.Dark))
{
_blurWindow = new UIVisualEffectView(blurEffect)
{
Frame = UIApplication.SharedApplication.KeyWindow.RootViewController.View.Bounds
};
UIApplication.SharedApplication.KeyWindow.RootViewController.View.AddSubview(_blurWindow);
}
}
我在这里使用黑暗。 您可以将模糊效果更改为 Light、Regular 或列出的任何其他选项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.