开发者

UITableViewController and TableView Height

开发者 https://www.devze.com 2023-04-02 16:11 出处:网络
I am inheriting my view controller from UITableViewController. I have a header (logo), content (uitableview) and now I want to display the footer (uitabbar). But for some reason UITabBar is not visibl

I am inheriting my view controller from UITableViewController. I have a header (logo), content (uitableview) and now I want to display the footer (uitabbar). But for some reason UITabBar is not visible. The space is being occupi开发者_JS百科ed by the UITableView. How can I fix this?

UPDATE 1:

- (void)viewDidLoad

{

[super viewDidLoad];

self.view.backgroundColor = [UIColor clearColor];


self.tableView.tableFooterView = self.tabBar;

}


I'm not sure you can put a UITabBar as a footer of a UITableView.

"footer of the tableView" meaning it won't be visible until you scroll your UITableView all way down past the last cell to then see the footer -- the header and footer of a tableView scrolls with the tableView content itself). Anyway in term of UX this seems very strange.

You probably want instead your UITabBar to always be visible at the bottom of your screen (and not being dependant of the scrolling of your UITableView). To do this, simply use a UITabBarController... that will then contain your UITableViewController (as the viewcontroller associated with one of its UITabBarItem)

[EDIT] See also Apple's View Controller Programming Guide and its paragraph about TabBarControllers.

0

精彩评论

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

关注公众号