iPhone table menu
Hi all i would like to build a menu that looks li开发者_高级运维ke a table and when i click on a cell it goes to another view. But i want for the tableView to be inside a UIView. I need starting points, like how it's done, not the actual coding. I dont want someone to write it for me
here are some examples on what i want
My Suggestion
You could use a container view, it will have your UITableView as a subview.
UIView* m_OthersView;
UIView* m_ContainerView;
UIView* m_TableView;
[self.view addSubviews:m_ContainerView];
[self.view addSubviews:m_OthersView];
if you need menu in your view,
[m_ContainerView addSubviews:m_TableView]
and if you don't
[m_TableView removeFromSuperview];
Thanks,
If what you want to accomplish is that background behind the table view and a custom size of the table view I suppose you could do the following in your viewDidLoad
of the table view controller
UIImageView *background = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"bg.png"]];
[self.view addSubview:background];
[self.view sendSubviewToBack:background]; // Now the background should be behind the table view.
self.tableView.frame = yourFrame;
I haven't tried it, but I think it should work. If not let me know.
精彩评论