[英]Disable user interaction on tabBar
I am displaying an image right after the app didFinishLaunchingWithOptions
, the app consists in a tab bar, and in the first view i have some buttons. 我正在应用程序didFinishLaunchingWithOptions
后显示一个图像,该应用程序包含在一个标签栏中,在第一个视图中我有一些按钮。 The user can only continue to use the app after he press the button in that first image, the problem is, some users can interact with the tab bar, and the buttons in the first view even with the image above all. 用户只能在按下第一张图像中的按钮后才能继续使用该应用程序,问题是,某些用户可以与标签栏进行交互,并且第一个视图中的按钮甚至可以使用图像。 How i can completely disable the user interaction on those buttons and in the tabBar, and enable then only when the button is pressed and the image disapear? 如何完全禁用这些按钮和tabBar中的用户交互,然后仅在按下按钮并且图像消失时启用?
To disable: 要禁用:
UITabBarController.tabBar.userInteractionEnabled = NO;
To enable: 启用:
UITabBarController.tabBar.userInteractionEnabled = YES;
if let items = self.tabBarController?.tabBar.items {
for i in 0 ..< items.count {
let itemToDisable = items[i]
itemToDisable.isEnabled = false
}
}
somehow i didn't fully understand what you described,but have you tried disabling your buttons using following code? 不知怎的,我没有完全理解你所描述的内容,但你是否尝试使用以下代码禁用按钮?
button1.Enabled=false;
also you can disable images click function using 你也可以使用禁用图像点击功能
image1.Enabled=false;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.