问题描述:

I'm using a UITabBarController in my app.

How can I disable people from clicking the tabs?

Trying to disallow people from clicking away to another section before some of the things that is going on is done.

Thank you,

Tee

网友答案:

Figured it out.

UITabBarController.tabbar.userInteractionEnabled = NO;//disable         
UITabBarController.tabbar.userInteractionEnabled = YES;//enable
网友答案:

You really shouldn't do that, it's very counterintuitive to the user. Instead of temporarily disabling user interaction with tabbar, present your content in a modal view (it completely overlaps the tabbar making user unable to change the tab).

相关阅读:
Top