开发者

Disable tableView, but enable UINavigationController's back button

开发者 https://www.devze.com 2023-02-19 20:15 出处:网络
I am disabling a UITableView while displaying a UIActivityIndic开发者_如何学运维atorView, and I just wanted to know how I could enable the UINavigationController\'s back button while the UITableView i

I am disabling a UITableView while displaying a UIActivityIndic开发者_如何学运维atorView, and I just wanted to know how I could enable the UINavigationController's back button while the UITableView is disabled?


I assume you meant to disable any user events from UITableView. Recall UINavigationController user events queue is independent of UITableView user events. So, by disabling UITableView the UINavigationController isn't affected.

Set the views userInteractionEnabled boolean value property to NO. This ignores user events and removes UITableView user events from the queue. i.e. controller.view.userInteractionEnabled = NO; OR self.view.userInteractionEnable = NO; (depending where your setting the property).

and right before disabling UITableView set the UINavigationItem property assuming the UINavigationController property is not hidden. The UINavigationItem will use the default "back" UIBarButtonItem if no new lefBarItem is set. i.e. [self.navigationItem setHidesBackButton:NO animated:YES];


What do you meant by disabling the UITableView? Do yo mean disabling the scroll? UITableView inherits from UIScrollView, so you can change the scrollEnabled property to NO, which shouldn't affect the UINavigationController at all.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号