Reputation: 3600
Is it possible to customize the look of the table view associated with the more tab of a tab bar? I'm wanting to set a cell background image and customize the text for each cell. I've found info about working with the navigation bar for the more view but can't seem to find anything about customizing its table view.
Upvotes: 0
Views: 1194
Reputation: 534950
You can do it to some extent, as explained in my book. Start with the UITabBarController's moreNavigationController
. Through it, you can access the root view controller: it is the first item in the UINavigationController's viewControllers
array. And through that, you can access the table view: it is the root view controller's view
.
The problem, however, is that the table view has a data source and a delegate, and you are not either of them - and you don't want to subvert what they do. In my book (see link above), I show how to insert your own data source in between the table view and the built-in data source, but what you can accomplish this way is limited, and it works differently in different systems (e.g. iOS 6 vs. iOS 7). Thus, for example, my book shows how (in iOS 6) you can change the font of the cells and eliminate the accessory detail chevron at the right end of the cells.
See also my downloadable example code (in this case, you would want to look at https://github.com/mattneub/Programming-iOS-Book-Examples/tree/master/bk2ch12p611tabBarMore).
Upvotes: 2
Reputation: 80265
Here is one idea, but I have not tried it:
The UITabBarController
has a property moreNavigationController
, which is a plain UINavigationController
. Unfortunately it is readonly
, so subclassing won't help, but you can most likely still manipulate it by setting a different topViewController
.
This seems worth a try. Let us know if it works.
Upvotes: 0