我想防止在应用程序中截取页面的屏幕截图。如何以编程方式进行操作,以便无法截取屏幕截图。
找到代码来检测屏幕截图。截图后可以删除吗?
let mainQueue = NSOperationQueue.mainQueue()
NSNotificationCenter.defaultCenter().addObserverForName(UIApplicationUserDidTakeScreenshotNotification,
object: nil,
queue: mainQueue) { notification in
// executes after screenshot
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试将菜单切换图标向左对齐,标题向标题中心对齐。我正在使用以下代码:
<ion-header>
<ion-toolbar color="primary">
<button ion-button menuToggle left>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>
Home
</ion-title>
</ion-toolbar>
Run Code Online (Sandbox Code Playgroud)
但是标题没有出现在中间。请帮忙。提前致谢。