开发者

Add views to "more" tab item

开发者 https://www.devze.com 2022-12-28 03:09 出处:网络
Is it possible to change appearence o开发者_开发问答f \"more\" item in TabBarController? For example can I add custom views and change layout of tableView containing \"more\" controllers list? Just fi

Is it possible to change appearence o开发者_开发问答f "more" item in TabBarController? For example can I add custom views and change layout of tableView containing "more" controllers list?


Just find it was already discussed in

Customizing the More menu on a Tab bar
https://discussions.apple.com/thread/2399024

So we can get instance of this "More" ViewController using:

UIViewController *moreViewController = tabBarController.moreNavigationController.topViewController;

In fact it is of undocumented class UIMoreListController declared as:

@interface UIMoreListController : UIViewController <UITableViewDelegate, UITableViewDataSource>

moreViewController.view property contain UITableView and we can use it, for example add tableHeaderView:

UITableView *moreTableView = (UITableView*)moreViewController.view;
moreTableView.tableHeaderView = myOwnCustomView;

But I am not sure is this code "applesafe"? Because it use private class although not explicitly. And what if I want to add a view that shouldn't scroll with table? Any ideas?


yes, this is all possible, if you could give us an example of what you want, maybe with a screenshot or something, then we can help you with some code examples


You can do what you want to do...

by using UITableViewController as a moreview tabbaritem.

and can create a moreview some what similar to the standard moreView controller.

0

精彩评论

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

关注公众号